-
Notifications
You must be signed in to change notification settings - Fork 20
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
[Task] ArchivedRecordingsTable does not properly update view state using notifications #430
Comments
This only happens on the archived recordings table under the Recordings view. The Archives view for all targets behaves as expected. |
I'm not quite familiar enough with this repo or React even but why do we check this in the ArchivedRecordingsTable and not the AllArchivedRecordingsTable? |
The The |
@hareetd Hey sorry, I am sort of lost on how to fix this... I've tried tracing the problem back upwards but I get stuck at Since the archived recording Notification doesn't include a target, isn't that the backend's fault for not providing it? Please let me know what I am missing and which way I should be pointed towards. |
Correct, the fix will require a patch to the backend to emit this information as well as a patch to the frontend to handle it accordingly.
The filtering performed is just that the notification's category matches the provided argument. Components don't generally need to subscribe to every kind of notification, only ones with one or two specific categories. In this case there's a notification category for when a recording is copied to archives, and another when a recording is deleted from archives, for example. |
So does this mean I have to file a new issue in [cryostat] to patch this then? |
Yep. |
How do I recreate this bug for case 2? I tried checking out Hareet's repo and doing it that way but the archive view was loading a while and I get errors. I'm also asking about a bit more clarification about case 2. Is it a problem that the UploadedRecordings don't have a target, or is it the ArchivedRecordings that get uploaded and sent to the AllArchivesView that don't have a target? |
Hareet's frontend changes require corresponding backend changes. You'll need to run both of them together, otherwise API requests will fail and result in the ever-loading views and errors you see. |
There are two separate actions here: saving active recordings to the archives vs. uploading recordings directly to the archives. The former issues As for the actual problem, we need both notification types to contain a target field in order to differentiate between saved vs. uploaded archived recordings. My Archives view PR will need this change because it has two tables, one for archived recordings linked to targets (i.e. created from saving active recordings on these targets) and one for uploads directly to archives. However, both tables use the |
I could also just listen separately for |
I'm having trouble finding the actual targetId the uploaded recordings come from. I'm rather certain that RecordingsPostHandler has the notifications that are being emitted, but unlike the Case 1 where the parentPath is the encoded serviceUri for the recordings, these uploaded recordings have no such parentPath and they just get put in the unlabelled folder of the archives. Then is it okay to have target: "unlabelled" or I am missing something? |
Yep, that's it. The target: "unlabelled" approach is actually what I had in mind for the solution as well. You just need something in the target field to help process the |
Now that https://github.com/cryostatio/cryostat/issues/986 is fixed, sorry I think I asked this before but what is there to do now for the front-end? |
You just have to take care of case 1. I'll use your backend changes to address case 2 in my All Archives PR. |
Forgive me if I'm looking at this wrong but since the original problem was that
but now it does, isn't the problem solved? I tried doing a ArchivedRecordingsDelete and it gets past the match now |
Ah right, I was thinking of the old @andrewazores In that case, since Max's backend PR takes care of case 1 and case 2 (indirectly), should it simply close this issue? |
When a notification is issued, before the table state is updated we check whether the current target in context matches the one described in the notification (see here). However, unlike the active recordings notifications, the archived recordings notifications do not contain a
target
field for matching theconnectUrl
of the current target so the state is never updated.Known cases:
Archived Recording Deleted
notifications do not update the table state [1, 2]The text was updated successfully, but these errors were encountered: