fix: remove mock data fallbacks and add proper loading/error states in profile hooks (closes #1676)#1869
Conversation
|
@Emmanard Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Great job so far There’s just one blocker — the workflow is failing. Could you take a look and fix it so all checks pass? Happy to review again once that’s done. |
e91d421 to
304839c
Compare
|
@RUKAYAT-CODER Rebased onto latest upstream main and fixed the Prettier formatting failures in the two new files ( |
|
Great job so far There’s just one blocker — the workflow is failing. Could you take a look and fix it so all checks pass? |
Did you please confirm what I commented first ? @RUKAYAT-CODER |
|
ok i just did. Sorry about not reading your message carefully.
…On Thu, Jul 2, 2026 at 12:26 PM Emmanuel Omunizua ***@***.***> wrote:
*Emmanard* left a comment (EarnQuestOne/stellar_Earn#1869)
<#1869 (comment)>
Great job so far
There’s just one blocker — the workflow is failing. Could you take a look
and fix it so all checks pass?
You could pull from the main to get the changes before pushing.
Did you please confirm what I commented first ? @RUKAYAT-CODER
<https://github.com/RUKAYAT-CODER>
—
Reply to this email directly, view it on GitHub
<#1869?email_source=notifications&email_token=AROKCTF2Q5XZ2HPCBQGY4Y35CZBHVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOBVGMZDSMBQGU3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4853290056>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AROKCTDITSRP2DTSAV46TGD5CZBHVAVCNFSNUABGKJSXA33TNF2G64TZHMYTCMZUHE2DGNZRHE5US43TOVSTWNBXG42TCMRSG4ZDPILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AROKCTAJOVVDWZEYY52Y2IT5CZBHVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOBVGMZDSMBQGU3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/AROKCTCTRYFK4K4HFYM5EYT5CZBHVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOBVGMZDSMBQGU3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Have approve all workflow |
|
Thanks will debug and fix now |
Summary
The hooks named in the issue (
useProfile,useQuests,useSubmissions) already make real API calls correctly. The actual source of mock data was one layer deeper —lib/api/profile.tshad all 6 exported functions fully mocked with hardcoded data behindawait delay(ms), with the real endpoints left as TODO comments.Changes
lib/api/profile.ts— rewrote all 6 functions to delegate to the existingget/post/patchclient instead of returning mock data (238 → 39 lines)tests/mocks/handlers.ts— added MSW handlers for all 6 profile endpoints, following the existing quest handler dual-URL patternlib/api/profile.integration.test.ts— new integration test file with 7 tests covering all 6 functions, happy path and error pathScope notes
lib/mock/quests.tsandlib/mock/submissions.tswere intentionally left untouched — they are still used bylib/api/admin.tsand the submissions page respectively, which are outside the scope of this issueProfileStats.tsxrequired no changes — it already reads from thestatsprop and will display real data automatically now that the API layer returns real datauseProfile.ts,useQuests.ts,useSubmissions.ts) required no changes — they were already correctly structuredTesting
All 7 new integration tests run under both
npm testandnpm run test:integration(file matches**/*.integration.test.ts)Closes #1676