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

Sometimes view websocket notifications are missed by frontend #977

Open
teosarca opened this issue Jun 1, 2018 · 0 comments
Open

Sometimes view websocket notifications are missed by frontend #977

teosarca opened this issue Jun 1, 2018 · 0 comments

Comments

@teosarca
Copy link
Member

teosarca commented Jun 1, 2018

Is this a bug or feature request?

Bug

What is the current behavior?

Case:
While creating a view, it might be that some async tasks to compute some included rows are triggered. When they are done, a websocket notification for that view is sent. (e.g. de.metas.ui.web.order.sales.purchasePlanning.view.PurchaseRowsLoader.notifyViewOfChanges(List)).

Might be that frontend isn't connected when the notification is sent, but it will connect couple of milliseconds after.
In that case, frontend will miss that notification, so it won't refresh the view rows, for example.

Which are the steps to reproduce?

Prerequirements:

  • sysconfig de.metas.ui.web.order.sales.purchasePlanning.view.SalesOrder2PurchaseViewFactory.AsyncAvailiabilityCheck is Y (see de.metas.ui.web.order.sales.purchasePlanning.view.PurchaseRowsLoader.isMakeAsynchronousAvailiabilityCheck())

  • pick an order, e.g. https://w101.metasfresh.com:8443/window/143/1000956

  • call Create purchase orders action

  • remark: might be that no websocket notification is sent so, the last row is not refreshed

image

And now, fetch the data again. Remark that the last row has an included row.
That row was notified on websocket but the notification was missed.
image

image

What is the expected or desired behavior?

Option 1. Backend fix

Queue websocket events if there is no subscriber for our destination.
As soon as somebody subscribes, the queued messages shall be delivered.
Technically, i think we shall extend/change org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.handleMessageInternal(Message<?>)

Option 2. Frontend fix

Make sure frontend is connecting to view's websocket topic BEFORE the view data is fetched.
e.g. In the case above

image

=> Issue: metasfresh/metasfresh-webui-frontend-legacy#1820

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant