Skip to content

fix: preserve the current deck when an older load finishes - #243

Merged
ChristopherVR merged 1 commit into
ChristopherVR:mainfrom
yunfeizhu:fix/stale-presentation-loads
Sep 11, 2026
Merged

ChristopherVR merged 1 commit into
ChristopherVR:mainfrom
yunfeizhu:fix/stale-presentation-loads

Conversation

@yunfeizhu

Copy link
Copy Markdown
Contributor

Switching from presentation A to B while A is resolving images or media lets A's successful load path replace B afterward. Any edits made in B can be discarded, and React clears the dirty flag and undo history.

Check cancellation again after asset resolution, before committing the loaded document. Keep React's media map local to the request until that check passes, and release uncommitted handlers and media URLs in finally. Vue's signature parsing also completes before the guarded state update.

Checked all five bindings. React, Vue, Angular, and Svelte reproduced the race and are fixed here. Vanilla already checks the token after its complete loading pipeline; its production code is unchanged, with the same regression cases added as a control.

Closes #242.

Validation

  • 22 focused tests: image and media completion after replacement or teardown in all five bindings, plus shared resource ownership tests. The 16 affected-binding cases fail with the original loaders at fc1d194312b85adb898f398497965d26aef967bf. Fixtures are real generated PPTX archives; only the timing of the actual asset read is controlled.
  • Full React viewer in Chrome 152 on macOS: open A, pause its image read, open and edit B, then release A. The original code restores A and reports saved; the fix retains the edited B and its unsaved state.
  • Existing file-backstage-open.spec.ts: 15 passed across all five demos using Chrome.
  • bun run build, bun run typecheck, bun run lint, and bun run fmt:check passed.
  • Ran each package's bun run test --maxWorkers=2: 40,869 passed, 234 skipped, and one failed test across the final package runs. React's existing random ID uniqueness test returned 4,999 unique IDs out of 5,000; its six-test file passed on rerun. The ID minter is unchanged. All new load regressions passed.

@github-actions github-actions Bot added react React binding (pptx-react-viewer) vue Vue binding (pptx-vue-viewer) angular Angular binding (pptx-angular-viewer) svelte Svelte binding (pptx-svelte-viewer) vanilla Vanilla binding (pptx-vanilla-viewer) shared Framework-agnostic viewer logic (pptx-viewer-shared) labels Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Cross-binding parity check

This is advisory only and does not block the PR. It looks at changed file paths, so it cannot tell a genuinely framework-specific change from a parity gap. If it is wrong here, just say so in a comment.

Binding This PR
React changed
Vue changed
Angular changed
Svelte changed
Vanilla not changed

UI source changed in 4 of 5 bindings

Changed: React, Vue, Angular, Svelte. Not changed: Vanilla.

If this is a new UI feature, it needs to land in all five. If it is a fix, please confirm in the PR description whether the other bindings have the same defect, and fix the ones that do. If the change really is framework-specific, say so and this note can be ignored.

Binding UI changed with no framework-neutral e2e spec

Specs in e2e/ run against all five demos, so they are what stops a binding quietly falling behind. New UI features should add or extend one. Fixes covered by unit tests can skip this.


See the parity rule for what is expected. Missing: Vanilla.

@ChristopherVR

Copy link
Copy Markdown
Owner

Looks good thanks for this.

@ChristopherVR
ChristopherVR merged commit a4ad9f8 into ChristopherVR:main Sep 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

angular Angular binding (pptx-angular-viewer) react React binding (pptx-react-viewer) shared Framework-agnostic viewer logic (pptx-viewer-shared) svelte Svelte binding (pptx-svelte-viewer) vanilla Vanilla binding (pptx-vanilla-viewer) vue Vue binding (pptx-vue-viewer)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switching presentations during asset loading can restore the previous deck and discard edits

2 participants