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

fix(replies): refresh replies when selection date is changed #50

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

mforesti
Copy link
Collaborator

No description provided.

@mforesti mforesti linked an issue Nov 17, 2024 that may be closed by this pull request
Copy link

Deploying appforit with  Cloudflare Pages  Cloudflare Pages

Latest commit: ff146bd
Status: ✅  Deploy successful!
Preview URL: https://4c562439.appforit.pages.dev
Branch Preview URL: https://49-replies-are-not-reloaded.appforit.pages.dev

View logs

@borgoat
Copy link
Member

borgoat commented Nov 19, 2024

I don't understand, we need to reload the whole group whenever the date changes?

@mforesti
Copy link
Collaborator Author

I don't understand, we need to reload the whole group whenever the date changes?

No, we do not, but that's a quick fix, considering the following:

  • we do not have much time
  • the selectors need to be refactored and memoized
  • reloading the group is not (yet) expensive with respect to performance and data

@borgoat
Copy link
Member

borgoat commented Nov 19, 2024

No I mean it's fine that we do the query per se, I do not understand what is the side effect? Is it reloading the replies?
And if so, can't we just reload the replies?

@mforesti
Copy link
Collaborator Author

No I mean it's fine that we do the query per se, I do not understand what is the side effect? Is it reloading the replies? And if so, can't we just reload the replies?

Unfortunately, there are many needed side effects:

  • Schedules
  • Replies
  • Default replies

Therefore, instead of repeating/amending every side effect with a new action, it felt quicker to trigger the reload of the group. I am not fond of action reuse, either. I just wanted to solve it quickly and tackle the whole construct at another time and focus on the next issue for the beta release.

@borgoat
Copy link
Member

borgoat commented Nov 19, 2024

Hmm fair enough I'm not really sure reloading default replies and schedules should be needed, but maybe I'm missing something or there are other bugs somewhere... conceptually the idea of schedules and default replies should be that there are very few of them, potentially they are even cached. While replies of course need only be loaded for the specific instances of schedules one is looking at (so yes on date change they MUST be reloaded)

Anyway we can keep it this way now, and think about it later .. an idea I had anyway was to use this new layer for persistence that should simplify custom code in repositories a lot https://getdutchie.github.io/brick/

@borgoat borgoat merged commit 8c8f936 into main Nov 19, 2024
2 checks passed
@borgoat borgoat deleted the 49-replies-are-not-reloaded-when-date-is-changed branch November 27, 2024 13:23
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.

Replies are not reloaded when date is changed
2 participants