Skip to content

Add profile editing (C++) - #12

Merged
jssng-pinetree merged 4 commits into
mainfrom
bug2/profile-edit
Nov 3, 2026
Merged

jssng-pinetree merged 4 commits into
mainfrom
bug2/profile-edit

Conversation

@solari-ci-status

Copy link
Copy Markdown

Adds editing of an existing profile through the profile editor (PROFILE-EDIT).

  • profiles.edit opens the editor (POST /profiles/:id/login-handoff) and returns a handle with the editor URL (valid ~30 min), handoff id, expiry and start version, plus status, save-and-close, exit-without-saving and wait-for-save.
  • Expired or used link surfaces as status 404, editor not running 409, failed save 502 (editor stays open); wait-for-save timeout or link expiry is status 408. No save without closing, no auto-save.
  • Profile now carries version from the list.
  • Tests use a fake gateway that checks the paths and the X-Handoff-Id header. README, CHANGELOG and version (v0.5.0) included; not published until merged.
  • Staging check against the live gateway comes once the gateway endpoints are deployed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YBdoPgL3puPebUVTLPGmcX

jssng-pinetree and others added 2 commits November 3, 2026 01:08
@solari-ci-status

solari-ci-status Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Author

ARCHI-SIGNOFF browser e5977c1

Verified: read the diff (src/profile_editor.cpp, profile_editor.hpp, http.cpp extra headers, client.cpp, types, CMake, README, CHANGELOG). Configured and built with CMake on Linux; ctest passes. Mutants: > to >= in waitForSave fails; dropping the X-Handoff-Id header fails. The null editorStatus becomes idle. Expiry parsing handles Z, +hh:mm and epoch ms.

Non-blocking: parseExpiresAt uses timegm, which is not available on MSVC (_mkgmtime), and std::min is used without including <algorithm>. CI builds on Linux only and the SDK uses libcurl/OpenSSL, so nothing breaks today; fix on the next touch. ProfileEditor keeps a raw Client* (the header says the Client must outlive it).

Cross-SDK note (not specific to this PR; the TypeScript SDK behaves the same): the transport retries a 502 on any method, so a failed saveAndClose is replayed once or twice, and the console answers the replay with 409 "not in a savable state" (the failed save has already moved the editor to error). The caller therefore sees 409, not the 502 the README describes. Worth fixing for all SDKs in one go (no retry on the editor save call) before publishing, and then the "502, retry" sentence can stay.

Live test: I did NOT see a live staging test. The gateway's editor save and exit routes are not working on staging yet, so this sign-off covers the SDK code against the documented wire shape only. Publishing is a separate step and needs the gateway fix live first.

Co-Authored-By: Claude Sonnet 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01MiLFVaN9mLhqJcQZhRAbzU

jssng-pinetree and others added 2 commits November 3, 2026 01:28
…table date math for expiresAt

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBdoPgL3puPebUVTLPGmcX
@solari-ci-status

Copy link
Copy Markdown
Author

Live staging retest (api-sta.getsolari.com, gateway staging-822584240087 with #434), C++ SDK at 1f85388: throwaway profile in the nightly org, deleted afterwards.

  • Launch, open the link in a browser and click Open editor: status idle → launching → editing.
  • Real save (after a 15 s settle): save-and-close returns version 2 and the list shows version 2; the used link then answers 404.
  • Launch then exit: exit succeeds; a save after exit gets 409.
  • Expired link / timeout: wait-for-save returns 408 (and returns the new version at once when the profile is already past the start version).
  • Save and exit are single-attempt; a failed save is a plain 502 error.

https://claude.ai/code/session_01YBdoPgL3puPebUVTLPGmcX

@solari-ci-status

Copy link
Copy Markdown
Author

ARCHI-SIGNOFF browser 1f85388

Diff against my last sign-off read in full. Changes: save and exit are single-attempt, the README / doc text now says a failed save is a 502, the editor goes to error, exit and start a new edit (a second save gets 409), and the null editorStatus is idle.

C++: noRetry on HttpTransport::request; the date math no longer uses timegm. I built and ran ctest (pass), and compared the new parseExpiresAt with Python's calendar math for 2030-01-01T00:30:00.000Z, 2024-02-29 (leap day), 2000-03-01, the epoch, one second before the epoch, and +01:00 / -07:00 offsets: all equal. Mutant: save with retry on fails the test. CI green.
Live staging: I read bug2's retest posted on this PR (real save to version 2 then the link answers 404; exit then save gives 409; expiry gives 408; single-attempt confirmed). I did not run it myself.

One thing in that retest is worth fixing in the service, not in this SDK: a save sent right after the status first turns editing once failed with "Failed to export storageState: fetch failed" and, being single-attempt, left the editor in error. It saved fine after waiting about 15 s. A person signing in takes longer than that, so normal use is not affected, but a script that saves immediately can hit it.

Co-Authored-By: Claude Sonnet 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01MiLFVaN9mLhqJcQZhRAbzU

@jssng-pinetree
jssng-pinetree merged commit 3b0c0aa into main Nov 3, 2026
1 check passed
@jssng-pinetree
jssng-pinetree deleted the bug2/profile-edit branch November 3, 2026 01:55
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