Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

hu lines appear only after refresh #1216

Closed
metas-lc opened this issue Sep 25, 2017 · 10 comments
Closed

hu lines appear only after refresh #1216

metas-lc opened this issue Sep 25, 2017 · 10 comments

Comments

@metas-lc
Copy link

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

  1. create any document: e.g. purchase order
    you can take this example https://w101.metasfresh.com:8443/window/181/1000016
  2. add a product with TU, complete
    => notice that the HU line is not shown NOK
  3. refresh the page
    => HU line is shown
@teosarca
Copy link
Member

teosarca commented Sep 25, 2017

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.
image

@ottosichert ottosichert self-assigned this Oct 6, 2017
@ottosichert
Copy link
Contributor

Notes to dev:

@ottosichert
Copy link
Contributor

Right now this must be a backend issue

  1. Create new purchase order
  2. Create new purchase order line
  3. Select product
  4. Select HU
  5. Save
    • => OK: Product appears in list
    • => NOK: HU does not appear in list
    • => NOK: HU does not appear in list even after refreshing!

When this issue is resolved, i can continue with the refreshing issue

@teosarca
Copy link
Member

teosarca commented Oct 6, 2017

@ottosichert u need to complete the purchase order

@ottosichert
Copy link
Contributor

@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).

  1. Create new purchase order
  2. Create new purchase order line
  3. Select product
  4. Select HU
  5. Save
  6. Complete
    • => OK: PATCH request is sent to http://w101.metasfresh.com:8081/rest/api/window/181/1000016
      [{"op":"replace","path":"DocAction","value":{"CO":"Fertigstellen"}}]
      
    • => OK: Response 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"}]
      
    • => OK: UI updates and shows Completed on top right
    • => NOK: No websocket message is sent (besides h every 25s)
      bildschirmfoto vom 2017-10-06 21-56-52
      (picture shows userSession, same goes for notifications)
    • => NOK: Sales order items stay the same, no HU line is added

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.
bildschirmfoto vom 2017-10-06 22-01-19

Are there supposed to be more websocket connections I missed out? Otherwise thats the problem

@teosarca
Copy link
Member

teosarca commented Oct 9, 2017

@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.

@teosarca
Copy link
Member

teosarca commented Oct 9, 2017

@ottosichert quick checked but it's frontend. Take a look:

image
image

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.

image

@ottosichert
Copy link
Contributor

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

@teosarca
Copy link
Member

@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.....

@metas-rc
Copy link
Member

Results of IT

OK: the HU line is displayed in the purchase order as soon as the order is completed.

metas-ts added a commit to metasfresh/metasfresh that referenced this issue Oct 13, 2017
[#2699](#2699) NPE when
pressing Complete for an invoice with no lines
[#2700](#2700) Set
correct identifiers in the table M_ShipmentSchedule
[#2643](#2643) Forecast
in Material Disposition
[#628](metasfresh/metasfresh-webui-api-legacy#628)
Extend framework to allow modification of standard filter results
[#1239](metasfresh/metasfresh-webui-frontend-legacy#1239)
Included views are not working in non-modal windows
[#2711](#2711)
productdescription in sales order jasper
[#2645](#2645) Source HU
Automatism for Manufacturing Issue
[#2400](#2400) discount
in manual sales invoice
[#518](#518) Easier
solution to clear the Picking Slots
[#1216](metasfresh/metasfresh-webui-frontend-legacy#1216)
hu lines appear only after refresh
[#2704](#2704) Show an
explicit error message when reports don't open because of logo missing
[#2693](#2693)
C_Flatrate_Conditions.C_Flatrate_Transition_ID needs to be mandatory
[#1224](metasfresh/metasfresh-webui-frontend-legacy#1224)
Error when pressing Action after completing an invalid document
[#1232](metasfresh/metasfresh-webui-frontend-legacy#1232)
Labels widget: keyboard support

me-45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants