Repository navigation
fix(client): UI blank after #176 — declare roster before the tab-title effect #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| The web UI no longer stops at "Failed to load plugins — ds-bot": the tab-title effect added in #176 read `roster` before it was declared. A regression test checks the order. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import test from 'node:test' | ||
| import assert from 'node:assert/strict' | ||
| import { readFileSync } from 'node:fs' | ||
|
|
||
| // `ctx.effect` runs its body immediately, so an effect that reads `roster` before | ||
| // `const roster` is declared throws a TDZ error and the whole client plugin fails to | ||
| // load (blank "Failed to load plugins" page, #176 regression). | ||
| test('client apply declares roster before effects that read it', () => { | ||
| const src = readFileSync(new URL('../src/client/index.js', import.meta.url), 'utf8') | ||
| const declared = src.indexOf('const roster = createSource(') | ||
| assert.ok(declared > 0, 'roster declaration found') | ||
| for (const label of ['ds-bot: tab title']) { | ||
| const effect = src.indexOf(`'${label}'`) | ||
| assert.ok(effect > 0, `${label} effect found`) | ||
| assert.ok(declared < effect, `${label} must come after const roster`) | ||
| } | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import test from 'node:test' | ||
| import assert from 'node:assert/strict' | ||
| import { readFileSync } from 'node:fs' | ||
|
|
||
| // `ctx.effect` runs its body immediately, so an effect that reads `roster` before | ||
| // `const roster` is declared throws a TDZ error and the whole client plugin fails to | ||
| // load (blank "Failed to load plugins" page, #176 regression). | ||
| test('client apply declares roster before effects that read it', () => { | ||
| const src = readFileSync(new URL('../src/client/index.js', import.meta.url), 'utf8') | ||
| const declared = src.indexOf('const roster = createSource(') | ||
| assert.ok(declared > 0, 'roster declaration found') | ||
| for (const label of ['ds-bot: tab title']) { | ||
| const effect = src.indexOf(`'${label}'`) | ||
| assert.ok(effect > 0, `${label} effect found`) | ||
| assert.ok(declared < effect, `${label} must come after const roster`) | ||
| } | ||
| }) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because
core/test/client-apply-order.test.jsexists only incore/and not underpatches/ds-bot/files/test/, the requirednode scripts/ds-bot-patches.mjs checkreports this file as "committed but not produced by the patches"; consequentlynpm run verifycannot pass, and rebuildingcore/from the patches drops this regression test. Regenerate the patch payload so the new file is stored verbatim alongsidecore/.AGENTS.md reference: AGENTS.md:L69-L69
Useful? React with 👍 / 👎.