Issue 45405: SM: Async import status from other folders are registering in the current LKSM folder.

issues
Status:open
Assigned To:triage
Type:Defect
Area:Sample Manager
Priority:3
Milestone:22.07
Opened:2022-05-03 18:35 by Dan Duffek
Changed:2022-06-09 16:12 by hannahb
Resolved:
Resolution:
Support Ticket: 
Pull Requests:
Closed:
2022-05-03 18:35 Dan Duffek
Title»SM: Async import status from other folders are registering in the current LKSM folder.
Assigned To»triage
Type»Defect
Area»Sample Manager
Priority»3
Milestone»22.07
Stumbled across this while running different automated test locally.

Create a LKSM folder and create a sample type.
Create a second LKSM folder.
In the first project/folder import some samples using async
    Add the useAsync=true parameter to the url.
As expected you should see the notification icon at the top of the page.
Go to the second project.

Result:
The notification icon at the top of this project also shows a completed async import.
However if you look at the background imports for this project nothing is listed.

See attached screen shot.
 
 Async_Imports_Across_Folders.png

2022-05-04 09:25 jeckels
Notify»Andrew
I think this is an interesting design question. Should we filter the list based on your current context? Or should we give you info on what folder notifications are from?

In LKS we show all notifications from all folders in the header, without showing which folder a given notification came from.

2022-05-11 13:16 hannahb
Assigned Totriage»Susan Hert
NotifyAndrew»Andrew;Nick Kerr;Bernie;Susan Hert
Something to consider as well - how should this expect to work in the Projects scenario?

Here's my general thoughts:
- Probably don't need to see notifications in completely separate LKS projects
- Would like to see notifications in a LKB/LKSM world where I have multiple subfolders/Projects

It would be nice to know general estimates for just not showing notifications from other folders vs handling the case(s) outlined above.

2022-05-11 14:12 Susan Hert
Assigned ToSusan Hert»xyang
Xing, you did the original notification work, can you provide an estimate here?

2022-05-11 14:17 jeckels
NotifyAndrew;Nick Kerr;Bernie;Susan Hert»Andrew;Nick Kerr;Bernie;Susan Hert;jeckels
I recently did some work on the server side to cache the counts.

https://github.com/LabKey/platform/blob/fe6a01a85e2a4a1d4483622ab6679e308dcc883a/core/src/org/labkey/core/notification/NotificationServiceImpl.java#L216

Right now we're able to provide the unread notification count for a single container or the whole server. We could add a ContainerFilter option too if needed. Xing, let me know if you want to discuss.

2022-06-08 17:12 xyang
Assigned Toxyang»triage
Estimate for following is 3 hours.
- Probably don't need to see notifications in completely separate LKS projects
- Would like to see notifications in a LKB/LKSM world where I have multiple subfolders/Projects

Caching the unread count wouldn't help with the current implementation since full notification data (not just icon) is fetched on app load time. If we ever switch to lazy loading of notifications, then a cached count would work.

The current GetUserNotificationsAction already have container param, and LKSM's intention was to get notification for the current project only. However, there is a bug with the current implementation because "container" is not an allowed param name so it's ignored. (see HasAllowBindParameter.java) We can change the param name to notificationContaienr, and apply the subfolder logic to the notification utils.

2022-06-09 13:21 Andrew
It seems like a user in one Project should never see Notification information from another one, even if they have access to both. The point of Projects was to isolate data and access control, and shared notifications would break that.

2022-06-09 16:12 hannahb
Given that notifications were not meant only to support async import, I'm struggling with keeping Projects completely separate. For example, if I can do all my work across Projects from a single top level folder, shouldn't I be able to see all the notifications across those there? Or perhaps that's an okay scenario, but not cross-Project notifications within a Project.

Maybe as a first step, we do as Xing proposes where *at least* we're not showing notifications across LabKey Server Projects? Seems like a quick convo might be useful