Entry sync on foundry keeps creating new journal entries #111
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Can you fix it? It keeps creating empty entries forever. It shouldn't do that
Let me look at the exact reconcile code and the test helpers once more before editing.
I've traced the notes→journal reconcile thoroughly. The reconcile only creates a page when it can find it neither by the campaign's stored page id nor by the
dragonroll-foundry.noteIdflag on the page. The item sync has a third fallback (adopt an unmapped document of the same name) that the notes sync lacks, which is what lets duplicates accumulate. Let me implement the parallel behaviour and cover it with tests.Let me also make the create path re-apply the page's flag the way the actor/item sync marks its documents, so a page that does not keep its create-time flag is still claimed.
Fixed issue #111. The notes→journal reconcile in
dragonroll-foundry/scripts/api.jsonly recognised a page through the campaign's storedfoundryPageIdor the page'sdragonroll-foundry.noteIdflag. When both were missing — a page that lost its mark, or a pairing the campaign never kept — it created a fresh page every reconcile, so the world filled with endless empty entries.Changes
dragonroll-foundry/scripts/api.js(reconcileDragonrollNotes)applyDragonrollNotePageon the page just created, so a world that drops the flag handed tocreateEmbeddedDocumentsstill ends up with a marked page (the same way actors/items are re-marked from the backend response).Tests
tests/foundry-note-journal.test.js— addedkeepCreateFlags/failMapNoteknobs to the world stub and three tests:Verified: with the code reverted, those three tests fail; with the fix they pass. Full suite: 389/389 pass (
npm test).Docs updated in
dragonroll-foundry/README.mdandfrontend/app/content/docs/03-integrations/03-foundry.mdto describe the title-adoption rule.No commit or push was made; the working tree on
ai/issue-111holds only these four files.Implementation is ready for review: #112
The automated implementation stopped because of an internal error. Please check the worker logs for details.