`/new-topic` redirects back to `/latest`, so the ember router considers this to be a 'refresh'. This triggers the `resetParams()` logic, which would cause the transition to abort, and the composer would never open.
This commit fixes the `resetParams()` logic so that it uses the default values, instead of setting everything to `null`. Therefore the transition is no longer aborted, and the composer opens successfully.
Unfortunately I have not been able to reproduce the issue in a QUnit test.
This change both speeds up specs (less strings to allocate) and helps catch
cases where methods in Discourse are mutating inputs.
Overall we will be migrating everything to use #frozen_string_literal: true
it will take a while, but this is the first and safest move in this direction
We had quite a few cases in core where inputs are being mutated as a side
effect of calling a method.
This handles all the cases where specs caught this.
Mutating inputs makes code harder to reason about. Eg:
```
frog = "frog"
jump(frog)
puts frog
"fly" # ?????
```
This commit is part of a followup commit that adds # frozen_string_literal
to all our specs.
On busy sites, concurrent requests to insert into post_timings can
occur, which was dealt with using Ruby exceptions.
This moves the handling to PostgreSQL which makes it a bit faster,
and prevents a spam of ERROR in the database logs.
If a tag group is set to only be visible to staff, and is restricted
to a category that is visible by everyone, the tags in the group were
being shown on the /tags page. They weren't visible anywhere else.
This commit fixes it so they don't show on the /tags page.
Without forcing a reload on start internal state in the accelerator can be
off. In Rails 5 not translation is being called so this is not an issue but
in 6 it is called earlier on.
This test failed IF this category id number 3 was fabricated to start with
at the top of the test.
This is very likely if the test is run on a blank DB
AWS is a big moving target, this fills gaps in the API. Technically we
use such a tiny surface area that it probably does not matter, but it is
good to be up to date here.