Repository navigation
fix(bridge): one configurable link limit for the bridge and the mirror - #390
Ferdinand99 wants to merge 3 commits into
Conversation
…r (BRIDGE_MAX_LINKS, default 100) The bridge capped a server at 10 links while the server mirror linked up to 50, so the page could show 35 of 10. Both now share one limit set by the operator with BRIDGE_MAX_LINKS (1 to 500, default 100). A mirror links up to it and reports the rest as not linked; the Bridge page explains how to raise it and never shows a count above the limit. The relay spaces each webhook by what its platform allows.
There was a problem hiding this comment.
Graphify reviewed this change.
Code graph out of date: Health delta baseline: last indexed commit a9ec8af (diverged from this PR's base — delta is approximate). Impact and hotspot numbers below may be wrong.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Not checked: tests were not run; no formal proof of the changed code.
Graphify review — findings
Adds an operator-set BRIDGE_MAX_LINKS (default 100, range 1 to 500) that caps bridged channels per server, replacing the old fixed limits of 10 by hand and 50 via mirror. Hand-made links and server-mirror links now count against the same cap, and Sylo refuses to start if the value is not a whole number in range. When a mirror hits the cap, it links up to the limit and lists the remaining channels in its report as "not linked", and they get linked on a later "Copy again" once the limit is raised or links are removed. The bridge docs, self-hosting table and .env.example are updated to match, including how each platform's webhook rate limits shape the relay's send spacing.
Worth a look
- Platform gap is skipped when a new enqueue arrives just after a lane goes idle —
src/modules/lib/bridgeQueue.js:136· Escalate · medium- NOT verified (no proof, no reproducing execution) — needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 278 functions depend on the 261 functions this change touches.
Health — this change adds coupling hotspots:
- new:
acceptLink()— 7 callers, 18 callees - new:
linkMirroredChannels()— 4 callers, 18 callees - new:
handleMessage()— 4 callers, 18 callees - new:
requestLink()— 7 callers, 8 callees - new:
failLink()— 5 callers, 9 callees - new:
resumeLink()— 4 callers, 11 callees - new:
createMirrorLink()— 2 callers, 18 callees - new:
bridgeOverview()— 3 callers, 10 callees - …and 26 more — each is listed as a finding
Verification — 278 functions in the blast radius were not formally verified this run (proofs are advisory here).
Health delta baseline: last indexed commit a9ec8af (diverged from this PR's base — delta is approximate).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 278 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
696 of 696 test file(s) selected (100%) via static blast radius.
Escalated to a full run for safety (
noncode-change,uncovered-code) — the selection is not trustworthy on its own (see below). CI should run the whole suite.
apps/sylo-ios/SyloKit/Tests/SyloKitTests/Access/DashboardAccessTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Access/Round3Tests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/AccountConnectTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/AccountModelTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/ConnectCallbackSourceTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/NoDashboardLinkSourceTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Appeals/AppealsReviewTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationFormsTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationPassthroughTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationSubmissionsTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationWireTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Audit/AuditHistoryTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Audit/AuditLogTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/CallbackIssuerAddressTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/CallbackIssuerTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/KeychainTokenStoreTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/PKCETests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/SignInRequestTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/TokenStoreTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Changelog/ChangelogTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Commands/CommandOverridesTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/CollectiblePictureTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/EconomyAdminTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/EconomyMembersTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/InventoryTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/ShopExtrasTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/ShopItemsTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/ShopModelTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Embeds/EmbedDraftTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Embeds/ModuleLimitsTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Events/CommunityReviewFixesTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Events/EventEndpointsTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Giveaways/GiveawayActionsTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/GuildSettings/CommandPrefixTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/GuildSettings/GuildSettingsTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Health/HealthTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Import/P6Tests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Insights/InsightsTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Leaderboard/LeaderboardTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Members/MemberDataTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Members/MemberSearchTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Messages/ComposedMessagesModelTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Messages/ComposedMessagesTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/ModelDecodingTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/ServerListTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/Sylo52PolishTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/UnknownKeysTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/Utf16TextLimitTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/Moderation/ModerationTests.swift— full-run-safetyapps/sylo-ios/SyloKit/Tests/SyloKitTests/ModuleSettings/AfkSettingsTests.swift— full-run-safety- … and 646 more
non-code file(s) changed (
.env.example,docs/mirror.md,docs/modules/bridge.md,docs/self-hosting.md) → running the full suite for safety (a code graph can't see config/fixture/data deps)
changed code file(s) with no mapped test (
docs/mirror.md,docs/modules/bridge.md,docs/self-hosting.md) — a coverage gap or a missing link — running the full suite rather than only the selected tests
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
What
The Bridge page could show "Bridged channels (35 of 10)" after a server mirror: the bridge capped a server at 10 links, while the mirror linked up to 50 on its own ceiling.
BRIDGE_MAX_LINKS(default 100, 1 to 500, anything else stops startup with a clear message). Documented indocs/self-hosting.md,.env.example,docs/modules/bridge.mdanddocs/mirror.md.Tests
test/bridgeLimit.test.js: parsing and bounds ofBRIDGE_MAX_LINKS, default 100, request and accept refusals, the page count, platform spacing of the queue.test/mirrorBridgeLink.test.js: the mirror stops at the limit (hand-made links count), reports the rest, and links them once the limit is raised.web-v2/src/__tests__/Bridge.test.jsx: the count and the note at, below and above the limit.