Skip to content
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

Add inititiatorClientId to SSE event data #8677

Closed
AlexAndBear opened this issue Mar 18, 2024 · 1 comment · Fixed by #8701
Closed

Add inititiatorClientId to SSE event data #8677

AlexAndBear opened this issue Mar 18, 2024 · 1 comment · Fixed by #8701
Assignees

Comments

@AlexAndBear
Copy link
Contributor

General

For web clients, it's essential to determine the originator of a request to trigger an SSE Event. The initiator could be a browser, a mobile client, or even a browser tab. For instance, a user might initiate a delete action in one browser tab and expect the corresponding resource to be deleted in another tab through SSE Event logic.

Including the initiatorClientId in the emission will enable us to identify whether the current client instigated the request. This identification is crucial because, in most cases, we don't require a response to the SSE Event. Instead, our proprietary business logic will execute, eliminating the need to listen for the event and potentially duplicate this logic, which could also involve additional server resource requests.

The initiatorClientId could be generated by the client itself and transmitted through request headers during graph or WebDAV requests to the server. Subsequently, it can be emitted via the SSE event.

Alternatively, the server can inform the client of its initiatorClientId. This information can then be utilized by the client and transmitted through request headers during graph or WebDAV requests, eventually being emitted via the SSE event.

Real world example

When a folder is deleted in the active browser tab where we are currently located, our business logic automatically navigates us to the parent folder. However, in a second browser tab where we haven't initiated this action, the SSE Event Business logic will be triggered to display a message advising us to navigate elsewhere without automatically moving us to the parent folder. This is to ensure accessibility compliance. Without the initiatorClientId, we would display this message on both browser tabs, which would be incorrect in the first case where we've already navigated to the parent folder.

@AlexAndBear AlexAndBear changed the title SSE add inititiatorClientId Add SSE inititiatorClientId to event data Mar 18, 2024
@AlexAndBear
Copy link
Contributor Author

Note:

Enabling the described feature allows us to bypass some SSE event business logic if the clientId matches the initiatorClientId. This is because the existing business logic in the web already handles the actions effectively.

@AlexAndBear AlexAndBear changed the title Add SSE inititiatorClientId to event data Add inititiatorClientId to SSE event data Mar 18, 2024
@kobergj kobergj self-assigned this Mar 19, 2024
@kobergj kobergj moved this from Qualification to In progress in Infinite Scale Team Board Mar 20, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Infinite Scale Team Board Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants