Skip to content

Guard repeat comm-prefs setup and cache setup state in memory#10435

Open
nopcoder wants to merge 1 commit into
masterfrom
chore/setup-comm
Open

Guard repeat comm-prefs setup and cache setup state in memory#10435
nopcoder wants to merge 1 commit into
masterfrom
chore/setup-comm

Conversation

@nopcoder

@nopcoder nopcoder commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • SetupCommPrefs now returns 409 Conflict on a repeat call instead of silently overriding stored communication preferences.
  • Cache the initialized and comm_prefs_set states in memory (sticky once observed true) so the UI's repeated setup-state polls don't hit KV on every check.
  • These states only ever transition false→true, so a cached true is correct indefinitely.

SetupCommPrefs now rejects a repeat call with 409 instead of silently
overriding stored preferences. Cache the initialized and comm_prefs_set
states in memory once observed true so the UI's repeated setup-state
polls don't hit KV on every check.
@nopcoder nopcoder added exclude-changelog PR description should not be included in next release changelog minor-change Used for PRs that don't require issue attached mostly-ai labels Jun 8, 2026
@nopcoder nopcoder self-assigned this Jun 8, 2026
@github-actions github-actions Bot added area/testing Improvements or additions to tests area/auth IAM, authorization, authentication, audit, AAA, and integrations with all those labels Jun 8, 2026
@nopcoder nopcoder requested a review from a team June 8, 2026 11:15

@N-o-Z N-o-Z left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can't understand this rationale from a product standpoint.
I would expect users to be able to opt in - in case they initially opted out. This seems like a business interest as well.
I expected this change to check if we're post setup - and if we are to gate this API with an authorization check (e.g.: admin)

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

Labels

area/auth IAM, authorization, authentication, audit, AAA, and integrations with all those area/testing Improvements or additions to tests exclude-changelog PR description should not be included in next release changelog minor-change Used for PRs that don't require issue attached mostly-ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants