JMitnik / haas

haas
0 stars 0 forks source link

Generic problematic dialogues table + Workspace interactions overview #424

Closed Cold-A-Muse closed 2 years ago

Cold-A-Muse commented 2 years ago

Fixes HAAS-371

In this PR

Known bugs:

This happens with and without adjusted filter. This is probably caused by GetWorkspaceSessions randomly being called again the moment the interaction modal is opened. query params both before and after opening modal are the same so this is not the cause of the re-render

Adding a skip: isOpenModal fixes this but instead it would cause a re-render whenever the modal is closed and it is a hacky way that doesn't solve the actual problem.

Logging the sessions (useState) I notice that after clicking an interaction the dialogue + followUpAction fields are changed to null for the session in the state. However, the data seems to be available in the newly fetched query.

I tried swapping to opening the modal without changing the route using boolean value instead but it still re-renders 😭

Edit: Seems that changing network-policy to 'no-cache' from 'network-and-cache' fixed the issue of both the rerender and disappearing data 😬. However, this also doesn't seem like the ultimate fix as you obv rather cache pages if they remain the same.

Edit 2: Swapping to the default fetch-policy (cache-first) also seems to fix the issue and still supports caching. I am not sure why network-and-cache acts so strange though and it itches my brain.

Edit 3: Actually doesn't seem to work as when you move between pages when you go back to your first page where u clicked on some entries the data is gone again :/

linear[bot] commented 2 years ago
HAAS-371 Simple Dialogue Table (API)

## Description We want to have our issues table now reflect "negative" dialogues (initially, we can make it a toggle if need be). The idea is that it stays quite similar to the current Issues table, but instead of Issues, it just shows negative Dialogues ranked by their `urgencyScore` (formerly called `actionRanking` for issues). The `urgencyScore` is calculated through a heuristic (currently implemented in `IssueService.calculateScore`). We need to do this now on the Dialouge scope rather than an Issue scope. * [ ] Implement a similar function for the Dialogue as is done in Issues

JMitnik commented 2 years ago

So there were two bugs, essentially, plaguing your cache: