fix: align license_service with Worker flat response shape#34
Conversation
Worker ok() returns {token, tier, features} at the root - not wrapped
under a 'data' key. Both activate() and validateOnline() were looking
for body['data']['token'], causing 'Invalid response' on every valid
activation attempt.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesLicensing Server Response Parsing
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Preview deployed
Updates automatically on every push. |
Summary
ok()helper returns{ token, tier, features }at the response root - there is nodatawrapperlicense_service.dartwas readingbody['data']['token'], which is alwaysnull, causing every valid activation to throw'Invalid response from licensing server'activate()to readbody['token'],body['tier'], andbody['features']directlyvalidateOnline()to read the refreshedtokenfrombody['token']directlyRoot cause
Discovered by reading
src/lib/response.tsin the Worker repo:And
src/routes/activate.ts:The Flutter client expected
{ "data": { "token": "..." } }which never matched.Test plan
validateOnline()should refresh the JWT correctlySummary by CodeRabbit
Bug Fixes
Refactor