Commit Graph

47197 Commits

Author SHA1 Message Date
Alan Guo Xiang Tan 5103268312
DEV: Run system tests with documentation and profiling on actions (#19271)
When a test takes too long, we want to know which test and at what step
2022-12-01 05:54:17 +08:00
Alan Guo Xiang Tan 7688628993
FIX: horizontal scrolling was not working correctly (#19236)
Fixes broken behaviour of arrow buttons for certain users as the interval to scroll menu can be cancelled before the scrolling actually happens.

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2022-12-01 05:27:53 +08:00
dependabot[bot] d44c2d471c
Build(deps): Bump rubocop-ast from 1.23.0 to 1.24.0 (#19270)
Bumps [rubocop-ast](https://github.com/rubocop/rubocop-ast) from 1.23.0 to 1.24.0.
- [Release notes](https://github.com/rubocop/rubocop-ast/releases)
- [Changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-ast/compare/v1.23.0...v1.24.0)

---
updated-dependencies:
- dependency-name: rubocop-ast
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-30 22:17:50 +01:00
Daniel Waterworth d9364a272e
FIX: When following redirects before cloning, use the first git request (#19269)
This is closer to git's redirect following behaviour. We prevented git
following redirects when we clone in order to prevent SSRF attacks.

Follow-up-to: 291bbc4fb9
2022-11-30 14:21:09 -06:00
Isaac Janzen aea492df5e
DEV: Add link rel preload to theme-javascripts (#19231)
* DEV: Add link rel preload to theme-javascripts
2022-11-30 12:43:01 -06:00
David Taylor 07fb7fc54d
DEV: Colocate all chat component templates (#19266) 2022-11-30 17:55:07 +00:00
Roman Rizzi 9bb5cf1c46
FIX: Validate unsubscribe key has an associated user (#19262)
* FIX: Validate unsubscribe key has an associated user

* Improve error messages
2022-11-30 14:29:07 -03:00
Jarek Radosz 49e0fc04f7
Revert "DEV: Clean up all message bus subscriptions (#18675)" (#19267)
This reverts commit b0839ccf27.
2022-11-30 16:29:10 +00:00
Jarek Radosz 6a389fd15a
FIX: ScrollingPostStream regressed in #15313 (#18584)
regression commit: bec76f937c

In case when the user navigates away between async actions that code would error out on a missing element. This adds a simple sanity check.
2022-11-30 16:55:30 +01:00
David Taylor 2b53c2cfca
DEV: Enable `@cached` decorator for themes and plugins (#19261)
`ember-cached-decorator-polyfill` uses a Babel transformation to apply this polyfill in core. Adding that Babel transformation to themes and plugins will be complex, so we use this to patch it at runtime. This can be removed once `@glimmer/tracking` is updated to a version
with native `@cached` support.
2022-11-30 15:53:54 +00:00
Jarek Radosz b0839ccf27
DEV: Clean up all message bus subscriptions (#18675)
1. "What Goes Up Must Come Down" – if you subscribe to message bus, make sure you also unsubscribe
2. When you unsubscribe - remove only your subscription, not **all** subscriptions on given channel
2022-11-30 16:49:51 +01:00
Jarek Radosz 321b14d40c
DEV: Remove unused `render()` calls (#19224)
`Route#render` and `Route#renderTemplate` have been deprecated and are removed in Ember 4.x (see: https://deprecations.emberjs.com/v3.x#toc_route-render-template)

The templates of modified routes in this PR are already automatically inserted into `{{outlet}}`s.
2022-11-30 16:49:23 +01:00
dependabot[bot] 2ecfdb345f
Build(deps): Bump ember-source in /app/assets/javascripts (#19265)
Bumps [ember-source](https://github.com/emberjs/ember.js) from 3.28.10 to 3.28.11.
- [Release notes](https://github.com/emberjs/ember.js/releases)
- [Changelog](https://github.com/emberjs/ember.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/emberjs/ember.js/compare/v3.28.10...v3.28.11)

---
updated-dependencies:
- dependency-name: ember-source
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-30 16:30:23 +01:00
dependabot[bot] 769b8b2405
Build(deps): Bump eslint-plugin-qunit in /app/assets/javascripts (#19263)
Bumps [eslint-plugin-qunit](https://github.com/platinumazure/eslint-plugin-qunit) from 7.3.3 to 7.3.4.
- [Release notes](https://github.com/platinumazure/eslint-plugin-qunit/releases)
- [Changelog](https://github.com/platinumazure/eslint-plugin-qunit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/platinumazure/eslint-plugin-qunit/compare/v7.3.3...v7.3.4)

---
updated-dependencies:
- dependency-name: eslint-plugin-qunit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-30 16:10:54 +01:00
Alan Guo Xiang Tan 7c321d3aad
PERF: Update `Group#user_count` counter cache outside DB transaction (#19256)
While load testing our user creation code path in production, we
identified that executing the DB statement to update the `Group#user_count` column within a
transaction is creating a bottleneck for us. This is because the
creation of a user and addition of the user to the relevant groups are
done in a transaction. When we execute the DB statement to update
`Group#user_count` for the relevant group, a row level lock is held
until the transaction completes. This row level lock acts like a global
lock when the server is creating users that will be added to the same
group in quick succession.

Instead of updating the counter cache within a transaction which the
default ActiveRecord `counter_cache` option does, we simply update the
counter cache outside of the committing transaction.

Co-authored-by: Rafael dos Santos Silva <xfalcox@gmail.com>

Co-authored-by: Rafael dos Santos Silva <xfalcox@gmail.com>
2022-11-30 11:52:08 -03:00
David Taylor 9f022112e3
DEV: Support theme/plugin overrides of colocated component templates (#19237)
To theme/plugin developers, the process is the same as for overriding non-colocated component templates. Once merged, this should allow us to seamlessly convert all of core's component templates to be colocated.
2022-11-30 14:14:38 +00:00
David Taylor 105f500693
FIX: Show chat channel info on reviewable items (#19260)
`reviewable.chat_channel` is a plain javascript object from the server's JSON response. We need to turn it into a true `ChatChannel` object before passing to `<ChatChannelTitle>`

This commit also converts `<ReviewableChatMessage>` to a Glimmer component
2022-11-30 14:08:30 +00:00
David Taylor 6969e9da7e
FIX: Allow reviewable-item components to be template-only (#19257)
The akismet plugin defines the `reviewable-akismet-post` component using a template under `discourse/templates/components/reviewable-akismet-post.hbs` without an associated `.js` file. The change to our resolution logic in c1397670 wasn't considering this.
2022-11-30 12:55:12 +00:00
Krzysztof Kotlarek 99fa10eee6
FIX: margin for sidebar and revamped user menu on iPad (#19254)
Additional top margin when footer is visible on iPad
2022-11-30 13:45:38 +11:00
Martin Brennan 9d50790530
FIX: Allow svg in oneboxer in certain cases (#19253)
When doing local oneboxes we sometimes want to allow
SVGs in the final preview HTML. The main case currently
is for the new cooked hashtags, which include an SVG
icon.

SVGs will be included in local oneboxes via `ExcerptParser` _only_
if they have the d-icon class, and if the caller for `post.excerpt`
specifies the `keep_svg: true` option.
2022-11-30 12:42:15 +10:00
dependabot[bot] e669cf3648
Build(deps): Bump @babel/core in /app/assets/javascripts (#19250)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.20.2 to 7.20.5.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.20.5/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-30 01:07:28 +01:00
dependabot[bot] c6467e2c9b
Build(deps): Bump ember-auto-import in /app/assets/javascripts (#19252)
Bumps [ember-auto-import](https://github.com/ef4/ember-auto-import/tree/HEAD/packages/ember-auto-import) from 2.4.3 to 2.5.0.
- [Release notes](https://github.com/ef4/ember-auto-import/releases)
- [Changelog](https://github.com/ef4/ember-auto-import/blob/main/packages/ember-auto-import/CHANGELOG.md)
- [Commits](https://github.com/ef4/ember-auto-import/commits/v2.5.0/packages/ember-auto-import)

---
updated-dependencies:
- dependency-name: ember-auto-import
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-30 00:51:11 +01:00
dependabot[bot] b76b4a5643
Build(deps): Bump @babel/standalone in /app/assets/javascripts (#19251)
Bumps [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone) from 7.20.4 to 7.20.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.20.6/packages/babel-standalone)

---
updated-dependencies:
- dependency-name: "@babel/standalone"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 23:49:22 +01:00
dependabot[bot] 42c88dc910
Build(deps-dev): Bump @embroider/test-setup in /app/assets/javascripts (#19248)
Bumps [@embroider/test-setup](https://github.com/embroider-build/embroider/tree/HEAD/packages/test-setup) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/test-setup)

---
updated-dependencies:
- dependency-name: "@embroider/test-setup"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 23:46:31 +01:00
dependabot[bot] c1286af10c
Build(deps): Bump sinon from 14.0.2 to 15.0.0 in /app/assets/javascripts (#19249)
Bumps [sinon](https://github.com/sinonjs/sinon) from 14.0.2 to 15.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v14.0.2...v15.0.0)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 23:45:51 +01:00
dependabot[bot] 5c8f3671e0
Build(deps): Bump stackprof from 0.2.22 to 0.2.23 (#19247)
Bumps [stackprof](https://github.com/tmm1/stackprof) from 0.2.22 to 0.2.23.
- [Release notes](https://github.com/tmm1/stackprof/releases)
- [Changelog](https://github.com/tmm1/stackprof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tmm1/stackprof/compare/v0.2.22...v0.2.23)

---
updated-dependencies:
- dependency-name: stackprof
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-30 05:14:53 +08:00
Jan Cernik 93fcfa58d0
FIX: Improve message when posting a duplicate link (#19245)
If the duplicated link was posted by the user itself, it will display
a different JIT message.
2022-11-29 16:08:27 -03:00
Roman Rizzi 88a0384d43
FIX: Don't notify of post deletion when agreeing with automatic flags. (#19241) 2022-11-29 14:18:07 -03:00
Daniel Waterworth aab4ea1849
Version bump to v2.9.0.beta14 (#19242) 2022-11-29 10:59:53 -06:00
Daniel Waterworth 84c83e8d4a
SECURITY: Filter tags in user notifications for visibility (#19239) 2022-11-29 10:35:41 -06:00
Bianca Nenciu 0cc6e678bb
FIX: Show error message if no uploads are allowed (#19133)
It used to fail without displaying an error message if no upload
extensions were authorized. This also disables the button in the
first place to avoid displaying an error to the user (the error
will be displayed only when drag and dropping a file).
2022-11-29 16:58:50 +02:00
Discourse Translator Bot cf347811c6
Update translations (#19238) 2022-11-29 15:36:51 +01:00
Bianca Nenciu 3048d3d07d
FEATURE: Track API and user API requests (#19186)
Adds stats for API and user API requests similar to regular page views.
This comes with a new report to visualize API requests per day like the
consolidated page views one.
2022-11-29 13:07:42 +02:00
David Taylor c139767055
DEV: Remove `Ember.TEMPLATES` and centralize template resolution rules (#19220)
In the past, the result of template compilation would be stored directly in `Ember.TEMPLATES`. Following the move to more modern ember-cli-based compilation, templates are now compiled to es6 modules. To handle forward/backwards compatibility during these changes we had logic in `discourse-boot` which would extract templates from the es6 modules and store them into the legacy-style `Ember.TEMPLATES` object.

This commit removes that shim, and updates our resolver to fetch templates directly from es6 modules. This is closer to how 'vanilla' Ember handles template resolution. We still have a lot of discourse-specific logic, but now it is centralised in one location and should be easier to understand and normalize in future.

This commit should not introduce any behaviour change.
2022-11-29 10:24:35 +00:00
Alan Guo Xiang Tan 8b2c2e5c34
UX: Align user page dismiss notifications btn with new navigation (#19235)
This change only affects the redesign user page navigation menu. The
dismiss button was incorrectly positioned below the user notifications
stream. A side effect of this is that it affected our infinite loading
code for the notifications stream.

No tests have been added in this commit as we have yet to quite figure
out how we can reliabily test for behaviours which requires us to scroll
the page.
2022-11-29 10:33:31 +08:00
Martin Brennan 6f0b9bb1c4
FIX: Allow hashtag autocomplete at start of line (#19216)
Back when we introduced hashtag autocomplete in
c1dbf5c1c4 we had to
disallow triggering it using # at the start of the
line because our old markdown engine rendered headers
with `#abc`, but now our new engine does `# abc` so
it is safe to allow hashtag autocompletion straight
away.
2022-11-29 10:56:17 +10:00
Krzysztof Kotlarek 787655e276
FIX: consistent narrow desktop width (#19232)
- use client rect instead of innerWidth to determine if screen is narrow
- disable _animate when exit mobile/narrow view
2022-11-29 11:03:54 +11:00
dependabot[bot] 7c75b5b100
Build(deps): Bump rack-protection from 3.0.3 to 3.0.4 (#19230)
Bumps [rack-protection](https://github.com/sinatra/sinatra) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/sinatra/sinatra/releases)
- [Changelog](https://github.com/sinatra/sinatra/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinatra/sinatra/compare/v3.0.3...v3.0.4)

---
updated-dependencies:
- dependency-name: rack-protection
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 00:35:23 +01:00
dependabot[bot] 2c37251e90
Build(deps): Bump engine.io in /app/assets/javascripts (#19233)
Bumps [engine.io](https://github.com/socketio/engine.io) from 6.2.0 to 6.2.1.
- [Release notes](https://github.com/socketio/engine.io/releases)
- [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/engine.io/compare/6.2.0...6.2.1)

---
updated-dependencies:
- dependency-name: engine.io
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 00:18:05 +01:00
Alan Guo Xiang Tan f14189eb3b
FIX: PMs displaying outdated unread counts when read status is processing (#19217)
When a client "reads" a post, we do no immediately send the data of the
post for processing on the server. Instead, read posts data is batched
together and sent to the server for processing at regular intervals. On
the server side, processing of read posts data is done in the
background. As such, there is a small window of delay before a post is
marked as read by a user on the server side.

If a client reads a topic and loads the messages topic list before the
server has processed the read post, the unread posts count for the topic
which the client just read will appear to be incorrect/outdated.

As part of tracking a post as read, we are already tracking the highest
read post number for the last read topic by the client. Therefore, we
can use this information to correct the highest post read number in the
scenario that was described above. This solution is the same as what
we've been doing for the regular topics list.
2022-11-29 05:55:48 +08:00
dependabot[bot] 07bc3ba139
Build(deps-dev): Bump bullet from 7.0.3 to 7.0.4 (#19229)
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.0.3 to 7.0.4.
- [Release notes](https://github.com/flyerhzm/bullet/releases)
- [Changelog](https://github.com/flyerhzm/bullet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/7.0.3...7.0.4)

---
updated-dependencies:
- dependency-name: bullet
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 05:44:22 +08:00
Joffrey JAFFEUX f7c29d959b
FIX: do not apply hover state to non capable devices (#19228) 2022-11-28 21:33:44 +01:00
Gerhard Schlager 0593e5f7c3
UX: Add instructions for multiple category emails (#19221) 2022-11-28 20:51:50 +01:00
Joffrey JAFFEUX 0291e1bf45
DEV: skip breaking tests (#19226) 2022-11-28 20:33:49 +01:00
chapoi bf9b346b76
UX: chat index UX fixes (#19227) 2022-11-28 20:33:39 +01:00
Leonardo Mosquera bfecbde837
Fixes for vBulletin bulk importer (#17618)
* Allow taking table prefix from env var

* FIX: remove unused column references

The columns `filedata` and `extension` are not present in a v4.2.4
database, and they aren't used in the method anyways.

* FIX: report progress for tables without imported_id

* FIX: effectively check for AR validation errors

NOTE: other migration scripts also have this problem; see /t/58202

* FIX: properly count Posts when importing attachments

* FIX: improve logging

* Remove leftover comment

* FIX: show progress when exporting Permalink file

* PERF: stream Permalink file

The current way results in tons of memory usage; write once per line instead

* Document fixes needed

* WIP - deduplicate category names

* Ignore non alphanumeric chars for grouping

* FIX: properly deduplicate user emails by merging accounts

* FIX: don't merge empty UserEmails

* Improve logging

* Merge users AFTER fixing primary key sequences

* Parallelize user merging

* Save duplicated users structure for debugging purposes

* Add progress logging for the (multiple hour) user merging step
2022-11-28 16:30:19 -03:00
Joffrey JAFFEUX a3abbe07db
FIX: ensures date/time don't linebreak (#19225) 2022-11-28 19:43:36 +01:00
David Taylor 7e504a1489
DEV: Only patch bootbox methods once in tests (#19222)
We were re-patching the deprecated bootbox methods during every app initialization, which would lead to hundreds of deprecation messages being printed for a single invocation.
2022-11-28 18:14:35 +00:00
Keegan George 7a8e018965
UX: reworks channel index (drawer and mobile) (#18892)
- Multiple style improvements
- adds last sent message date to the view

Co-authored-by: chapoi <charlie@discourse.org>
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2022-11-28 18:38:05 +01:00
Roman Rizzi 07a9163ea8
FEATURE: Deleting a user with their posts also deletes chat messages. (#19194)
This commit introduce a new API for registering callbacks, which we'll execute when a user gets destroyed, and the `delete_posts` opt is true. The chat plugin registers one callback and queues a job to destroy every message from that user in batches.
2022-11-28 13:32:57 -03:00