ocdevel / gnothi

Gnothi is an open-source AI journal and toolkit for self-discovery. If you're interested in getting involved, we'd love to hear from you.
https://gnothiai.com
GNU Affero General Public License v3.0
166 stars 18 forks source link

Summary + themes rickety on entry-view #159

Open lefnire opened 1 year ago

lefnire commented 1 year ago

When an entry is clicked, it goes:

  1. <Insights entry_ids={[entry.id]} /> is re-rendered (entry_ids is changed)
  2. useEffect(...., [entry_ids]) is debounced a bit, then triggers a re-fetch of insights_get_request

But there seems to be some sort of race-condition, because if you get into an entry too fast, or create an entry while something else is happening, then the "Summaries & Themes" insight (and maybe the other insights for that matter, just that Summaries & Themes is most obvious) either (a) remains unchanged (prior results); or (b) is blank, indicating the user doesn't have enough entries.

Investigate op: "update" changes like in here https://github.com/ocdevel/gnothi/commit/0f8bb1a4ee64869ff8649ed022523f7560c10fb0#diff-e8230420a204b9ff8677465015eccb5102d4495fbf839542902395002aeef8ceR174, which fixed similar problems