Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement changes due to Article DTO changes #17

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Dodje
Copy link

@Dodje Dodje commented Sep 6, 2024

As starting point here are some changes which were mentioned in the comment:
#16 (comment)

  • Separeted DTOs
  • Created Entity
  • Updated mapper methods
  • Removed mapping slug - from lists for cached data

And

  • Small fix: replaced updatedAt with createdAt in feed's ArticleMeta

Copy link

netlify bot commented Sep 6, 2024

Deploy Preview for realworld-fsd ready!

Name Link
🔨 Latest commit 225adcc
🔍 Latest deploy log https://app.netlify.com/sites/realworld-fsd/deploys/66e06eb0ba4f1e00088954fb
😎 Deploy Preview https://deploy-preview-17--realworld-fsd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@yurisldk yurisldk added the bug Something isn't working label Sep 6, 2024
@yurisldk yurisldk self-requested a review September 6, 2024 09:56
@yurisldk
Copy link
Owner

@Dodje sorry for the dalay.

I made some changes with favorite/unfavorite model. You can check that out.

As you mentioned, requests do not return up-to-date data in the case of an optimistic update, but cached data, we need to make changes to ignore the cache in certain cases, after that the main tasks will be done and the next goal is review and MR

@Dodje
Copy link
Author

Dodje commented Sep 12, 2024

I'm also sorry for delays, it just happens to coincide with vacation, but I'm trying to be online :)

we need to make changes to ignore the cache in certain cases

What would you suggest here? I'm not familiar with ReactQuery. But It seems like we are going to fix backend bug on frontend, which is not good at all..

Sadly backend is not working again, getting 500

Some update:
As I can see, there is the invalidation request queryClient.invalidateQueries({ queryKey: ArticleQueries.keys.root }) which makes our articles queries to refetch the data.

So we have onError method which changes state to previous, and on success we can do nothing actually.
Or I would actually suggest not to do anything at all and wait till backend fixes it's issues. Because when we update the page we will see false state of favorite button which is confusing confusing. But I believe it is not a frontend issue...

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants