Closed metas-lc closed 7 years ago
note to dev: The line it's not shown because the tab it's not refreshed. The tab it's not refreshed because somehow frontend it's not listening or it's not reacting to document's websocket events (check /document/{windowId}/{documentId} websocket topic).
the websocket endpoint it's provided when the document is loaded, e.g.
Notes to dev:
Add new
Batch entry
Right now this must be a backend issue
When this issue is resolved, i can continue with the refreshing issue
@ottosichert u need to complete the purchase order
@teosarca thanks for the advice.
I could narrow down the issue to no websocket message firing back after completing via sessionClient
or notificationClient
(e.g. to ws://w101.metasfresh.com:8081/stomp/445/oynldn2p/websocket
).
PATCH
request is sent to http://w101.metasfresh.com:8081/rest/api/window/181/1000016
[{"op":"replace","path":"DocAction","value":{"CO":"Fertigstellen"}}]
200
[{"windowId":"181","id":"1000016","fieldsByName":{"DocStatus":{"field":"DocStatus","value":{"CO":"Fertiggestellt"},"widgetType":"List"},"DocAction":{"field":"DocAction","value":{"RE":"Reaktivieren"},"widgetType":"Button"},"V$DocumentSummary":{"field":"V$DocumentSummary","value":"820472","widgetType":"Text"},"M_Warehouse_ID":{"field":"M_Warehouse_ID","readonly":true,"widgetType":"List"},"C_DocTypeTarget_ID":{"field":"C_DocTypeTarget_ID","readonly":true,"widgetType":"List"},"AD_Org_ID":{"field":"AD_Org_ID","readonly":true,"widgetType":"List"},"DocumentNo":{"field":"DocumentNo","readonly":true,"widgetType":"Text"},"DateOrdered":{"field":"DateOrdered","readonly":true,"widgetType":"Date"},"DatePromised":{"field":"DatePromised","readonly":true,"widgetType":"DateTime"},"PreparationDate":{"field":"PreparationDate","readonly":true,"widgetType":"DateTime"},"LotNumberDate":{"field":"LotNumberDate","readonly":true,"widgetType":"Date"},"C_BPartner_ID":{"field":"C_BPartner_ID","readonly":true,"widgetType":"Lookup"},"Bill_BPartner_ID":{"field":"Bill_BPartner_ID","readonly":true,"widgetType":"List"},"C_BPartner_Location_ID":{"field":"C_BPartner_Location_ID","readonly":true,"widgetType":"List"},"Bill_Location_ID":{"field":"Bill_Location_ID","readonly":true,"widgetType":"List"},"AD_User_ID":{"field":"AD_User_ID","readonly":true,"widgetType":"List"},"Bill_User_ID":{"field":"Bill_User_ID","readonly":true,"widgetType":"List"},"IsDropShip":{"field":"IsDropShip","readonly":true,"widgetType":"YesNo"},"DropShip_BPartner_ID":{"field":"DropShip_BPartner_ID","readonly":true,"widgetType":"Lookup"},"DropShip_Location_ID":{"field":"DropShip_Location_ID","readonly":true,"widgetType":"List"},"DropShip_User_ID":{"field":"DropShip_User_ID","readonly":true,"widgetType":"List"},"M_PricingSystem_ID":{"field":"M_PricingSystem_ID","readonly":true,"widgetType":"List"},"AD_Client_ID":{"field":"AD_Client_ID","readonly":true,"widgetType":"List"}},"includedTabsInfo":{"1":{"tabid":"1","stale":true,"allowCreateNew":false,"allowCreateNewReason":"ParentDocumentProcessed","allowDelete":false,"allowDeleteReason":"ParentDocumentProcessed"},"2":{"tabid":"2","stale":true}},"websocketEndpoint":"/document/181/1000016"}]
Completed
on top righth
every 25s)
(picture shows userSession
, same goes for notifications
)There are no websocket messages as well when a completed sales order is re-activated (sent back to draft).
The only other websocket connection is to ws://w101.metasfresh.com:8081/socket.io/?EIO=3&transport=websocket&sid=585-EsVA0TgWDqojAAAt
but there are no messages as well besides a back and forth of 2
and 3
every 25s.
Are there supposed to be more websocket connections I missed out? Otherwise thats the problem
@ottosichert thanks for research... I will debug it on server side too... but yes, a websocket event shall be sent by backend and frontend shall react to it and shall refresh the document/tab.
@ottosichert quick checked but it's frontend. Take a look:
And in parallel i was using our websocket test client (i.e. http://w101.metasfresh.com:8081/websocket_test.html), where i've subscribed to document's websocket endpoint. Here i can see that the notification was correctly sent from backend.
Thanks @teosarca for your input. The websocket test client is helpful for investigating this issue.
The problem is that no websocket connection is established for this document. There are websocket connections for e.g. /notifications/100
and /userSession/100
but not for /document/181/1000016
.
I will submit a PR for this issue
@ottosichert hmm that's pretty awkward because that was working in the past. But i don't know how it was implemented.... maybe it was somewhere hardcoded to refresh the document after calling the DocAction button.....
Results of IT
OK: the HU line is displayed in the purchase order as soon as the order is completed.
Type of issue
Bug
Current behavior
HU lines are not visible after you complete a document
Expected behavior
HU lines should appear right after you complete a document
Steps to reproduce