Fix browser quickstart profile management - #82
Merged
brionmario merged 1 commit intoAug 20, 2026
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
janithjay
force-pushed
the
fix-browser-quickstart-profile-management
branch
from
August 17, 2026 11:20
a2086b5 to
4d3cdbc
Compare
janithjay
marked this pull request as ready for review
August 17, 2026 11:23
janithjay
force-pushed
the
fix-browser-quickstart-profile-management
branch
3 times, most recently
from
August 19, 2026 07:16
706d20c to
948c374
Compare
Signed-off-by: janithjay <janithjayashan018@gmail.com>
janithjay
force-pushed
the
fix-browser-quickstart-profile-management
branch
from
August 19, 2026 09:45
948c374 to
dda08f8
Compare
brionmario
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The "Manage Profile" dialog in
samples/browser/quickstartwas broken. Saving any field failed with a400 Schema validation failedfromPUT /users/me, and the dialog only rendered two hardcoded fields (First name, Last name) populated from ID token claims instead of the user's real profile attributes, with no schema validation.On top of the schema-driven rewrite, two more issues surfaced while finishing this off. The per-field edit UI didn't match
@thunderid/react/@thunderid/vue'sBaseUserProfile, and saving a field closed the whole dialog unexpectedly. Verifying the fix with a real E2E run also surfaced a stale test (TC004) and a serious bug in the E2E harness's own cleanup step that deleted the local admin account instead of the test user it was meant to remove.Approach
@thunderid/browseris a headless, framework-agnostic layer. It ships no UI components. So the quickstart's hand-rolled dialog had drifted out of sync with what components actually do, and was sending a hardcoded, wrongly-shaped payload ({ name: { givenName, familyName } }) instead of the deployment's real (flat) schema attribute names.Rewrote
profileDialog.jsto mirror@thunderid/react/@thunderid/vue'sBaseUserProfilebehavior instead of hardcoding shapes,getUsersMeMeta) and current attributes (getUsersMe) before rendering.BaseUserProfile.required/regexagainst the schema client-side before submitting.deepMergebeforePUT /users/me, since that endpoint replaces the whole attributes document rather than merging.picture.Save/Cancel now match
BaseUserProfile's buttons, and saving no longer closes the dialogonSavedcalledrenderSignedInPage(), which replaces#app'sinnerHTML- destroying the dialog overlay, since it's appended as a sibling viainsertAdjacentHTML.onSavednow only updates in-memory user state (the dialog already refreshes its own header locally), and the full nav/page refresh is deferred to a newonClosecallback that fires after the dialog is actually dismissed.E2E coverage: fixed a stale test, and a harness bug that deleted the admin account
tests/e2e/tests/browser-quickstart/sign-in-out.spec.ts'sTC004and its page object (browser-quickstart.page.ts) were written against the dialog's old single-form design (#profile-first-name,#profile-dialog-save) before this PR's schema-driven, per-field-edit refactor landed. So it had never actually passed against current markup. Rewrote both to drive the real per-field edit/save UI (data-field/data-actionselectors), mirroring the already-correct pattern inreact-quickstart/vue-quickstart's equivalent test.global-teardown.tslooked up the shared test user viaGET /users?attribute=username&value=..., but the backend only recognizes a SCIM-stylefilter=<attr> eq "<value>"query param - the old query was silently ignored, returning the full unfiltered, ID-sorted user list. Since the seeded default admin's deterministic ID (01900000-...) sorts ahead of the randomly-keyed test user,users[0]was the admin account, and teardown deleted it. Fixed the query format, added a client-side exact-match check before deleting, and made a failed lookup throw instead of silently treating "we don't know" the same as "nothing to clean up."After fixes
Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks