cryostatio / cryostatio/cryostat-web
[Task] All-Archives view should avoid querying backend between re-rendering
- Dominant language
- TypeScript
- Stars
- 13
- Forks
- 21
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 35
Description
Right now, the parent `AllArchivedRecordingsTable` holds all states (i.e. counts, directories and its recordings) and query back-end on listened notifications, which trigger the entire table re-rendering.
> The new view works differently in that notifications refresh the entire page. This is done because the querying to the backend actually happens in the parent component `AllArchivedRecordingsTable` which contains multiple nested `ArchivedRecordingsTable`s <- these normally update state by themselves but the new view has a entirely different set of api calls that don't depend on jvmIds and such so I would have to create a new `ArchivedRecordingsTable`-like component to properly handle notifications instead of just refreshing the page, which I haven't done. It is entirely possible to do, but I'm not sure if this the current state is okay enough since tomorrow is the deadline.
One way to go around this issue (i.e. similar to AllTargetArchive) is that the parent `AllArchive` can query only the list of directories and counts. Then, pass in an optional `DirectoryOptions` props including the directory info to the ArchiveTable. Then, the archive can check if this option is available, and make the api calls to fetch recordings for that directory. I think we should do the same for uploads. But this seems to require some refactoring and maybe backend supports :D
_Originally posted by @tthvo in https://github.com/cryostatio/cryostat-web/issues/550#issuecomment-1278352478_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the AllArchivedRecordingsTable and nested ArchivedRecordingsTable components, then compare their state and notification behavior with AllArchive and AllTargetArchive. Trace which directory, count, and recording queries run during re-rendering. Done means the All-Archives view avoids redundant backend queries while preserving notification updates for recordings and uploads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100