0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/frontend
Ethan M 76e5cf8b70
FIX: Replace deprecated Array.clear in backup logs (#41834)
## What does this change?

Replaces the deprecated Ember native-array-extension call used when a
backup
operation starts:

```javascript
logs.clear();
```

with:

```javascript
logs.splice(0);
```

This clears the backup logs while preserving the existing
`@autoTrackedArray` instance.

## Why?

Starting a backup sends a `[STARTED]` message through the
`/admin/backups/logs` MessageBus channel. Its callback currently calls
`.clear()`, triggering:

```text
discourse.native-array-extensions.clear
```

When JavaScript deprecations are configured to raise errors, this also
causes
the MessageBus callback to fail.

## Testing

Added a unit test confirming that a `[STARTED]` message:

- clears existing backup-log entries;
- preserves the tracked-array instance;
- marks the backup operation as running;
- hides the read-only alert.

Local checks completed:

- Prettier
- ESLint
- Git whitespace checks

The focused QUnit test was not run locally because a complete
Ruby/Discourse
test environment was not installed.

---------

Co-authored-by: Bannon Tanner <bannon@discourse.org>
Co-authored-by: Bannon Tanner <bannon.n.tanner@gmail.com>
Co-authored-by: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com>
2026-07-27 11:53:32 -05:00
..
asset-processor DEV: add typescript support for core, themes and plugins (#41478) 2026-07-08 12:57:18 +01:00
deprecation-silencer DEV: Remove (again) the old non-rollup plugin compiler (#39419) 2026-04-21 21:07:46 +02:00
discourse FIX: Replace deprecated Array.clear in backup logs (#41834) 2026-07-27 11:53:32 -05:00
discourse-i18n DEV: add typescript support for core, themes and plugins (#41478) 2026-07-08 12:57:18 +01:00
discourse-markdown-it DEV: Bump eslint/lint-configs, and correct violations (#41321) 2026-07-01 10:39:57 +01:00
discourse-types DEV: Use bundler module resolution for @discourse/types consumers (#41661) 2026-07-13 21:43:39 -03:00
pretty-text FIX: clean up onebox loading decorations on fetch failure (#39277) 2026-07-23 19:50:41 -03:00
.npmrc DEV: Rename app/assets/javascripts/ -> frontend/ 2025-10-22 16:24:11 +01:00
polyfills.js DEV: Rename app/assets/javascripts/ -> frontend/ 2025-10-22 16:24:11 +01:00