Skip to content

feat(ios): the app follows the Sylo 5.3 server features - #384

Open
Ferdinand99 wants to merge 5 commits into
v5.3from
feat/53-ios
Open

Ferdinand99 wants to merge 5 commits into
v5.3from
feat/53-ios

Conversation

@Ferdinand99

Copy link
Copy Markdown
Owner

What

The iOS app learns the Sylo 5.3 server features. App version 1.3, build 10 (nothing is submitted to App Store Connect).

The server side is in #365 (moderator view), #366 (update notice), #367 (audit leftovers: restore of imported Postgres dumps) and #368 (public page look). They are not merged yet; the app follows their routes and feature strings.

  • Focused moderator view (moderator-view): a person whose level in a server is Inbox gets Tickets, Tools (applications, suggestions, member data) and Moderation (infractions, appeals; no commands) tabs, opening on the first inbox that is switched on. No modules, settings, audit log, insights or leaderboard. "Show everything" brings back the full, still locked, app on that device, and "Show Only Moderation Tools" goes back. View keeps the full read-only app and Edit is unchanged. Operator screens are in Settings and are not affected.
  • Public Pages (public-page-look): Server settings, Public Pages (Edit only). Accent colour with the contrast note, background (none, a photo from the library shrunk to the server's limits, or the server's invite background; only the values the server lists), and a preview of the application form page.
  • Update notice (update-notice, operators): Settings, Operator, Updates. The newer release with its notes, the release link, the command to copy, and, when the server reports Wise Wren, "Update now" after a confirmation, with the progress of the run that keeps going while Sylo restarts and ends on the new version. When Wise Wren refuses (409, open mode, nothing to approve) the server's own words are shown.
  • Restore of an uploaded Postgres dump (fix: audit leftovers (live-alert batches, DM ticket lookups, event image cache, restore role warning) #367): the restore call sends confirm and, for an uploaded dump, acknowledgeSql: true, after a sheet that explains that the SQL runs with the rights of the database role (with the role's extra rights and the docs link), and asks for an acknowledgement and the typed snapshot name.

Compatibility with older servers

The App Store build keeps talking to 5.2 and self-hosted servers.

  • Each new control is shown only when the server's /api/mobile/info features include its string (moderator-view, public-page-look, update-notice).
  • The restore has no feature string. The app sends confirm / acknowledgeSql only when the health report's db has roleRisks (the 5.3 server always sends it, an empty list when the role is fine). A 5.2 server gets no body, as before. The explanation of the SQL is shown on every version.
  • An Inbox person waits for the features to be read (a spinner) instead of seeing the full app and then the focused one.
  • Every new payload decodes leniently: missing, null or wrong-typed fields get defaults, an unknown background or run state is carried through.

Tests

Swift Testing, SyloKit: the focused-view rules (who gets it, tabs, landing, search), the update notice (5.3 payloads, odd payloads, run states, the model across a restart, rollback, give-up, Wise Wren refusal), the public look (decode, accent rules, calls, model), and the restore (5.2 and 5.3 health reports, request bodies, model). Two source guards list the new links and value-based destinations. The "iOS app" workflow builds and tests on the macOS runner.

The screens were not run in a simulator yet: the preview card, the Tools tab and the restore sheet need a look by eye.

- Focused moderator view for Inbox-level people on a server that announces
  `moderator-view`: Tickets, Tools (applications, suggestions, member data) and
  Moderation tabs, landing on the first inbox that is on, with a "Show everything"
  switch. View and Edit keep the full app.
- Server settings -> Public Pages (`public-page-look`, Edit only): accent colour
  with the contrast note, background (none, an uploaded picture, or the invite
  background) and a preview.
- Operator update notice (`update-notice`): newer release, notes, the command to
  copy, and "Update now" through Wise Wren with progress across Sylo's restart.
- Restoring a backup sends `confirm` and, for an uploaded Postgres dump,
  `acknowledgeSql` once the person has read what the SQL runs with; a server that
  did not send `roleRisks` gets no body.
- App 1.3 (build 10). Every new control is hidden unless the server sends its
  feature string or field, and every payload decodes without the new fields.

@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.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 3 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 a focused moderator view for Inbox-level people on Sylo 5.3 servers: they land on the first enabled inbox (tickets, appeals, applications, then the Moderation hub) and see only the moderation tools their level allows. A "Show everything" choice brings back the full, still locked app. Servers that don't announce moderator-view keep the full app, and the screen waits (undecided) while features are unknown so it doesn't flash the full app and then narrow it. Makes backup restore send a confirmation body (the snapshot name, plus an SQL acknowledgement for uploaded Postgres dumps) only to servers that support it. Older servers get no body, which the app detects by roleRisks being absent from the health report. Surfaces over-privileged Postgres role risks and a docs link from the health report. A malformed list or URL decodes as "not sent" rather than failing the whole report.

Worth a look

  • Restore silently drops the 5.3 confirmation body and the SQL-dump gate when the health report is not loaded — apps/sylo-ios/SyloKit/Sources/SyloKit/Operator/Backups.swift · Escalate · medium
    • NOT verified (no proof, no reproducing execution) — needs human review
  • Suggestions-only servers land on the applications page — apps/sylo-ios/SyloKit/Sources/SyloKit/Access/ModeratorView.swift:114 · Escalate · medium
    • NOT verified (no proof, no reproducing execution) — needs human review
  • Hex colour parser accepts signed digits after '#' — apps/sylo-ios/SyloKit/Sources/SyloKit/PublicLook/PublicPageLook.swift:287 · Escalate · medium
    • NOT verified (no proof, no reproducing execution) — needs human review

Review partial — this diff was larger than one review pass covers, so later files were not reviewed; some findings may be missing.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 596 functions depend on the 524 functions this change touches.

Health — this change adds coupling hotspots:

  • new: overview() — 5 callers, 4 callees
  • worse: HealthReport — 6 callers, 3 callees
  • new: RestoreConfirmation — 5 callers, 3 callees

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

Test selection

Test selection

677 of 677 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 — changed-test, 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 — test-dependency, 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 — test-dependency, 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 627 more

non-code file(s) changed (apps/sylo-ios/sylo-ios.xcodeproj/project.pbxproj, docs/mobile-app.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 (apps/sylo-ios/SyloKit/Sources/SyloKit/Access/ModeratorView.swift, apps/sylo-ios/SyloKit/Sources/SyloKit/Health/HealthModels.swift, apps/sylo-ios/SyloKit/Sources/SyloKit/Operator/Backups.swift, apps/sylo-ios/SyloKit/Sources/SyloKit/Update/UpdateNotice.swift, apps/sylo-ios/sylo-ios/Design/HexColor.swift …) — 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