feat: Resync All Journals button — re-pull + update existing journals (incl. permissions)#68
Merged
Merged
Conversation
…missions
Add a "Resync All Journals" action that re-pulls every Chronicle entity and
applies it to Foundry: updating existing journals (name, content, AND
permissions via _buildOwnership) as well as creating missing ones.
Unlike "Pull All" which only creates journals for chronicle-only entities,
resyncAll() fixes journals with stale permissions — the gap users hit after
changing Chronicle visibility settings.
Mirrors the MapSync.resyncAll / resync-all-maps pattern exactly:
- JournalSync.resyncAll({verbose}) — paginated entity fetch, sequential
update-or-create loop, honors _isExcluded / _isHandledByActorSync /
_syncing guard, returns {updated,created,skipped,errors}.
- Dashboard action 'resync-all-journals' with confirm dialog.
- "Resync All Journals" button in the Entities tab toolbar.
- Lang keys CHRONICLE.Dashboard.Entities.ResyncAllJournals/.Hint.
- 12 new node:test tests in tools/test-journal-resync-all.mjs.
Full suite: 497 tests, 0 failures.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y14Y6VXb7iB2xcNrYNDJa5
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cites: 2026-05-21-core-tenets §T-B1 (fail-closed visibility preserved).
Security implication: none new — the resync re-runs the existing fail-closed
_buildOwnership; it never over-shares.What this changes
Adds a "Resync All Journals" dashboard button (mirrors the existing "Resync All Maps"). Unlike "Pull All" — which only creates journals for entities that don't have one yet — this re-pulls every Chronicle entity and updates existing journals (content + ownership/permissions). So journals that synced before a permission change (e.g. after the #67/#488 permission-sync fix) get corrected in one click instead of re-saving each entity.
JournalSync.resyncAll({verbose})— updates existing (re-runs_buildOwnershipso permissions refresh) + creates missing; respects_syncing/_isExcluded/_isHandledByActorSync; per-entity error isolation; returns{updated, created, skipped, errors}.resync-all-journalsaction + confirm dialog + an Entities-tab button + lang strings.Why
After the permission-sync fix, there was no one-click way to refresh existing journals' permissions — re-saving each entity was the only option. This closes that gap (and gives a general "force a full refresh" button).
Test plan
node --test: 497 pass, 0 fail (+12 new tests)🤖 Generated with Claude Code
https://claude.ai/code/session_01Y14Y6VXb7iB2xcNrYNDJa5
Generated by Claude Code