Skip to content

Require explicit selection for initial container assignment - #535

Open
frankii91 wants to merge 2 commits into
privacyidea:masterfrom
frankii91:agent/limit-container-sync-token-data
Open

Require explicit selection for initial container assignment#535
frankii91 wants to merge 2 commits into
privacyidea:masterfrom
frankii91:agent/limit-container-sync-token-data

Conversation

@frankii91

@frankii91 frankii91 commented Jul 25, 2026

Copy link
Copy Markdown

Summary

  • send only tokens already linked to the smartphone container during normal synchronization
  • treat every eligible unlinked token, including tokens with a serial, as an explicit initial-assignment candidate
  • send only the candidates selected in the existing assignment dialog
  • persist completion of the first successful synchronization so later synchronizations cannot repeat initial assignment
  • keep initial assignment pending after a canceled or failed synchronization

Root cause

templatesForAssignment was populated automatically with every eligible unlinked serial-bearing token. This happened outside the user-selection dialog, and the existing initSynced field was never set after a successful synchronization. Consequently, unrelated token details could be included during normal synchronization and initial assignment could be considered repeatedly.

Behavior after this change

  • policy disabled or initial synchronization already completed: only tokens linked to this container are sent
  • initial assignment active: all eligible unlinked tokens are shown for selection and only selected tokens are sent
  • dialog canceled or synchronization failed: initSynced remains false and synchronization can be retried
  • synchronization succeeded: initSynced is persisted as true

Validation

  • flutter test --no-pub test/unit_test/api/privacy_idea_container_api_test.dart
  • flutter test --no-pub test/unit_test/state_notifiers/token_container_notifier_test.dart
  • both focused suites passed
  • focused flutter analyze --no-pub found no errors or warnings; four pre-existing prefer_initializing_formals info diagnostics remain

@frankii91 frankii91 changed the title Limit unlinked token data to initial container assignment Require explicit selection for initial container assignment Jul 26, 2026
@frankii91
frankii91 marked this pull request as ready for review July 26, 2026 12:53
@frankii91 frankii91 closed this Jul 26, 2026
@frankii91
frankii91 deleted the agent/limit-container-sync-token-data branch July 26, 2026 13:00
@frankii91
frankii91 restored the agent/limit-container-sync-token-data branch July 26, 2026 13:04
@frankii91 frankii91 reopened this Jul 26, 2026
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