Repository navigation
Keep the server running when the federation registry scan fails - #201
Open
NetworkTheoryAppliedResearchInstitute wants to merge 1 commit into
Open
NetworkTheoryAppliedResearchInstitute wants to merge 1 commit into
NetworkTheoryAppliedResearchInstitute wants to merge 1 commit into
Conversation
runFederationSync now catches a failed NodeRegistry scan, logs one line with the error message, and returns. Neither the first run that server.js starts nor the six-hour interval can reject unhandled and stop the process, and the next scheduled run scans again. Per-peer failures were already isolated and are unchanged. A missing Items field now counts as an empty registry. Tests: the federation sync job test calls the scheduled callback with a rejected scan and checks that it resolves and logs once as text, then advances the fake clock six hours and checks that the timer's next run syncs a healthy peer while another peer fails. Further tests cover a rejected scan on the first run started by the server and a scan with no Items. A scheduler test pins the same behaviour for sync/scheduler.js, which already contained the failure. Signed-off-by: Jodson Graves <info@ntari.org> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| promise: () => Promise.resolve({ Items: [{ url: 'http://down.example' }, { url: 'http://up.example' }] }) | ||
| }); | ||
| dynamodbClient.update.mockReturnValue({ promise: () => Promise.resolve() }); | ||
| axios.get.mockImplementation((url) => (url.startsWith('http://down.example') |
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.
What
runFederationSyncinfederation/federationSyncJob.jsnow catches a failed NodeRegistry scan, logs one line of text, and returns. Neither the startup run inserver.jsnor the six-hour interval can stop the process; the next run scans again. A scan with noItemscounts as empty.sync/scheduler.jsalready contained this failure and is unchanged.This does not change what federation imports or exports, or whether sync is scheduled.
Tests
Items: the run resolves.sync/scheduler.js: the same check, as a guard.The first three fail without the fix. Full suite: node:test 61/61, Jest 50/50.
Shares
federation/federationSyncJob.jsand its test with #194 and #197, andsync/__tests__/scheduler.test.jswith #194.🤖 Generated with Claude Code