Skip to content

feat(mirror): pick the Fluxer server from a list; point the Bridge page to Mirror - #389

Open
Ferdinand99 wants to merge 4 commits into
feat/53-mirror-bridge-linkfrom
feat/53-mirror-ux
Open

Ferdinand99 wants to merge 4 commits into
feat/53-mirror-bridge-linkfrom
feat/53-mirror-ux

Conversation

@Ferdinand99

Copy link
Copy Markdown
Owner

Stacked PR: this targets feat/53-mirror-bridge-link (#387), not v5.3. It goes in after that one.

Two changes from testing the Bridge and Mirror pages on a test instance, where a whole Fluxer server could not be set up from the Bridge page and the Mirror page asked for a pasted server id.

Bridge page points to Mirror

On a Discord server's Bridge page a short note near the top says: "Setting up a whole Fluxer server? Use Mirror to Fluxer to copy channels, roles and emoji and bridge every channel at once." It links to the Mirror page. It is shown only to the server owner, only when Sylo is connected to both platforms, and never on a Fluxer server (the mirror target is chosen from the Discord side).

Pick the Fluxer server instead of pasting an id

  • New route GET /api/v2/guilds/:guildId/mirror/fluxer-servers, classified edit in routeAccess.js, rate limited (12 per minute per person and server), and answered only for the owner of the Discord server. It lists only Fluxer servers that Sylo is in, that the person's own Fluxer login lists, and whose owner (as Fluxer reports it) is that login. Servers owned by someone else are never named, and the response is no-store.
  • Each entry has name, icon, member count, whether it is already part of a mirror, and notes when Sylo's role lacks the Administrator permission or is not the top role (the same checks the preview makes, from createFluxerTarget). The notes do not block picking; the preview still does.
  • The Ask step shows the list as radio buttons; picking one fills the request. "Enter an id instead" keeps the manual id field for a Fluxer server somebody else owns (that owner then agrees with the code as before). Without a connected Fluxer login the page says "Connect Fluxer under Account to pick your Fluxer servers" with a link. If the list cannot be loaded, the id field is shown.
  • The mirror state no longer carries candidates; the list has its own route.

Docs: docs/mirror.md and docs/modules/bridge.md.

Tests

  • test/v2Mirror.test.js: the owner filter, a server the login lists but Fluxer says is someone else's, a server Sylo knows that the login does not list (neither is named, nor leaks into the response), no Fluxer login, a non-owner Administrator (403), a Fluxer-side call (400), signed out, the notes, the in-use flag, the rate limit, and the access level.
  • test/v2.accessLevels.test.js: the new Edit-level GET is named on purpose.
  • Mirror.test.jsx and Bridge.test.jsx: the list, picking, the manual field behind its link and back, no Fluxer login, empty list, failed list, the Bridge note shown and hidden.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

No verdict: the code graph is out of date. Static checks found no blocking issues, but they compared against an outdated graph. The next push after the repository re-indexes gets a full review.

Not checked: tests were not run; no formal proof of the changed code.


Graphify review — findings

Adds an owner-only GET /guilds/:guildId/mirror/fluxer-servers endpoint so the Mirror page can offer a picker of Fluxer servers instead of asking for a pasted id. It lists only servers Sylo is in and the caller owns according to their own connected Fluxer login, with name, icon, member count, an "already in a mirror" flag and non-blocking notes when Sylo's role lacks Administrator or isn't the top role. It's rate limited at 12/min, requires Edit access, and returns connected: false when no Fluxer login is linked so the page can point to Account. The mirror state no longer carries the candidates list. The id-entry path stays as an "Enter an id instead" fallback for servers owned by someone else, which that owner then agrees to with a code. Docs for the mirror and the Bridge module now describe the picker, and the Bridge page points Discord server owners to Mirror to Fluxer for whole-server setups.

No blocking issues surfaced. 6 lower-confidence candidates did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 541 functions depend on the 339 functions this change touches.

Health — this change adds coupling hotspots:

  • worse: apiFetch() — 67 callers, 3 callees
  • new: Bridge() — 1 callers, 18 callees
  • new: PauseBlock() — 2 callers, 8 callees
  • new: RunningStep() — 1 callers, 14 callees
  • new: TargetView() — 1 callers, 11 callees
  • new: Mirror() — 1 callers, 9 callees
  • new: PreviewStep() — 1 callers, 8 callees
  • new: control() — 1 callers, 7 callees
  • …and 5 more — each is listed as a finding

Verification — 541 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: 537 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

695 of 695 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-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Access/Round3Tests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/AccountConnectTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/AccountModelTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/ConnectCallbackSourceTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/NoDashboardLinkSourceTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Appeals/AppealsReviewTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationFormsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationPassthroughTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationSubmissionsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationWireTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Audit/AuditHistoryTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Audit/AuditLogTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/CallbackIssuerAddressTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/CallbackIssuerTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/KeychainTokenStoreTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/PKCETests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/SignInRequestTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/TokenStoreTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Changelog/ChangelogTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Commands/CommandOverridesTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/CollectiblePictureTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/EconomyAdminTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/EconomyMembersTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/InventoryTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/ShopExtrasTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/ShopItemsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/ShopModelTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Embeds/EmbedDraftTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Embeds/ModuleLimitsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Events/CommunityReviewFixesTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Events/EventEndpointsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Giveaways/GiveawayActionsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/GuildSettings/CommandPrefixTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/GuildSettings/GuildSettingsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Health/HealthTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Import/P6Tests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Insights/InsightsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Leaderboard/LeaderboardTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Members/MemberDataTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Members/MemberSearchTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Messages/ComposedMessagesModelTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Messages/ComposedMessagesTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/ModelDecodingTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/ServerListTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/Sylo52PolishTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/UnknownKeysTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/Utf16TextLimitTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Moderation/ModerationTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/ModuleSettings/AfkSettingsTests.swift — full-run-safety
  • … and 645 more

non-code file(s) changed (docs/mirror.md, docs/modules/bridge.md, web-v2/src/styles/mirror.css) → 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, src/web/lib/routeAccess.js) — 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant