Skip to content

[LOOP-5150] storing user roles with session#76

Merged
nhamming merged 2 commits into
devfrom
nate/LOOP-5150/user-roles
Nov 20, 2024
Merged

[LOOP-5150] storing user roles with session#76
nhamming merged 2 commits into
devfrom
nate/LOOP-5150/user-roles

Conversation

@nhamming

Copy link
Copy Markdown
Contributor

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

LGTM!

@nhamming nhamming force-pushed the nate/LOOP-5150/user-roles branch from d761869 to 61b2fe7 Compare November 20, 2024 19:02
@nhamming nhamming force-pushed the nate/LOOP-5150/user-roles branch from 61b2fe7 to 8d67483 Compare November 20, 2024 19:04
@nhamming nhamming merged commit 854a812 into dev Nov 20, 2024
@nhamming nhamming deleted the nate/LOOP-5150/user-roles branch November 20, 2024 19:07
ps2 added a commit that referenced this pull request Jun 1, 2026
* Decode TSession.userRoles with backward compatibility

Sessions persisted before #76 added userRoles lack the key, so the
synthesized Codable decoder throws .keyNotFound. In TidepoolService that
kills init?(rawState:), which drops the saved service entry and forces
the user to re-authenticate on the next upgrade.

Provide a custom init(from:) that uses decodeIfPresent for userRoles
defaulting to []. Keeps the public API unchanged (userRoles stays
non-optional) and adds a backward-compat test.

* ci: bump Xcode to 16.4 on Apple Silicon resource class

CircleCI's m4pro.medium resource class does not support Xcode 14.1.0.
Use Xcode 16.4 and drop the OS pin on the simulator destination.

* tests: compare XCTAssertCodableAsJSON semantically

Newer Foundation emits Doubles at full IEEE-754 precision (e.g. 2.34 ->
2.3399...) and key order can differ between JSONEncoder and
JSONSerialization output -- both of which broke the previous raw string
comparison even though the data is equivalent. Parse both sides back to
Foundation objects and compare via NSObject equality, which handles
nested values, key ordering, and number equivalence by value.

Brings 46 pre-existing test failures back to green on current SDKs (and
preserves the encode/decode round-trip assertions).
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.

2 participants