Skip to content

Add sync-safe Anki Sorter gating - #6

Merged
bee-san merged 5 commits into
mainfrom
fix/mobile-sync-safe-sorting
May 31, 2026
Merged

Add sync-safe Anki Sorter gating#6
bee-san merged 5 commits into
mainfrom
fix/mobile-sync-safe-sorting

Conversation

@bee-san

@bee-san bee-san commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • default Anki Sorter to manual-only + mobile-guarded sorting so offline AnkiDroid reviews are not overwritten by automatic desktop resorting
  • add sync-safety decisions for after-sync/profile-open automation, manual/UI requests, and local API requests
  • require explicit acknowledgement for manual/API sorts, surface skipped-for-sync-safety results, and document the mobile-safe workflow

Verification

  • Parent QA t_635fdad5: PASS on 111 unittest tests, compileall, package build/inspection, and deterministic sync-safety smoke probe
  • Parent security t_73bc3495: APPROVE from data-loss/privacy/API safety perspective
  • Final gate local verification: python -m unittest discover -s tests (111 tests), python -m compileall addon scripts tests, python scripts/package_addon.py, package inspection, git diff --check

No release/signing included.

@sonarqubecloud

Copy link
Copy Markdown

@bee-san
bee-san merged commit 9fb8dad into main May 31, 2026
5 checks passed
@bee-san
bee-san deleted the fix/mobile-sync-safe-sorting branch May 31, 2026 11:15

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d98e40b462

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +36 to +39
if trigger in ACKNOWLEDGED_TRIGGERS:
if acknowledged:
return SortSafetyDecision(True, "acknowledged manual/API sort request")
return SortSafetyDecision(False, "manual/API sort request requires acknowledgement")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor desktop_only_allow_auto for API automation

For sorts requested through the local API, this branch returns before checking config.sync_safety_mode, so a profile configured with syncSafetyMode: "desktop_only_allow_auto" still gets skippedForSyncSafety unless the caller also sends the new acknowledgement field. I checked the optional systemd/anki-sorter.service template and it still invokes scripts/request_sort.py without that flag, so the documented desktop-only automation/timer opt-in will no-op instead of sorting.

Useful? React with 👍 / 👎.

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