[6/7] React migration: lazy UserProfile route - #749
Open
devanshi-gpta wants to merge 1 commit into
Open
devanshi-gpta wants to merge 1 commit into
devanshi-gpta wants to merge 1 commit into
Conversation
Co-Authored-By: Devanshi Gupta <devanshi.gupta@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Ports
src/app/user/tocomponents/user/UserProfile.tsxand adds the lazy/user/:idroute, mirroring the AngularUserModulelazy load. Fetch/abort and error handling follow the same pattern asFeed.Worth knowing before reviewing the runtime behavior: the upstream endpoint this view depends on,
https://node-hnapi.herokuapp.com/user/:id, no longer exists and responds 404 with an HTML body. That is equally true of the Angular version — the URL is unchanged — so the view renders its error state rather than a profile until the app moves to a different API. The API module rejects on!response.ok, so the failure surfaces as the component's error message instead of aSyntaxErrorfrom parsing HTML as JSON.Proposed fixes
UserProfile.tsx/UserProfile.scss./user/:idroute toApp.Link to Devin session: https://app.devin.ai/sessions/a3a0ff57bab64e25860349a003a282ef
Open in Devin Desktop: https://app.devin.ai/desktop/session/a3a0ff57bab64e25860349a003a282ef?variant=devin
Requested by: @devanshi-gpta