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

frontend patches too much in quick input field #2325

Closed
metas-ts opened this issue Jul 25, 2019 · 6 comments

Comments

@metas-ts
Copy link
Member

commented Jul 25, 2019

Is this a bug or feature request?

Bug

This bug blocks

What is the current behavior?

Quickentry in cypress tests

  • almost never works when executed on @TheBestPessimist's machine
  • generally works when @TheBestPessimist does manual quickentry on his local machine
  • generally works when I run both the cypress test and metasfresh locally
  • almost never works when the cypress test is run locally against metasfresh running on dev618

There is one "wrong" empty string patch and we don't know where it's coming from:

Screenshot

image

Screenshot-related notes:

payload of 1st "35" PATCH (OK)
[{op: "replace", path: "Qty", value: "222"}]

payload of 2nd "35" PATCH payload (NOK)
[{op: "replace", path: "Qty", value: ""}]

The following "complete" patch then fails because of the preceeding value: "" PATCH payload

Also note that

  • the problem also happened when I commented out type {selectall}, {force: true} and instead did an "extra"
    cy.writeIntoStringField('Qty', '{enter}', false /*modal*/, undefined /*rewriteUrl*/, true /*noRequest*/);
  • even when it works locally on my machine, i see two Qty patches. The difference is that the 2nd one also has value: "222"

Which are the steps to reproduce?

  • checkout the branch gh153_ts
  • get the config.js for dev618: config.js.zip
  • start the runner with CYPRESS_baseUrl=https://dev618.metasfresh.com npm run cypress:open
  • you can copy this test to cypress/integration/a: reverse_empties_return.js.zip
    • its hardcoded timestamp corresponds to a product, packaging, vendor etc etc which exsit on dev618, and it skips creating all those things

What is the expected or desired behavior?

@TheBestPessimist

This comment has been minimized.

Copy link
Member

commented Jul 25, 2019

Also related: #2322

@metas-ts

This comment has been minimized.

Copy link
Member Author

commented Jul 25, 2019

@siemiatj @TheBestPessimist

Also related: #2322

Right, issue #2322 adds even more information about what is aparently the same bug

@metas-ts metas-ts added the type:bug label Jul 25, 2019

@siemiatj

This comment has been minimized.

Copy link
Contributor

commented Jul 29, 2019

I'm having hard time reproducing this. For me no matter if I run this against local or dev618 it always works (at least this part as the test crashes later). I always have just one request with proper value both in cypress as well as when doing this manually.

Screen Shot 2019-07-29 at 14 54 57

Furthermore, the quickinput (and actually all Integer/Amount/Quantity) widget has a min value of 0, which prevents from typing negative values. So I'm not even sure how you can get #2322 happening.

Screen Shot 2019-07-29 at 14 57 31

But let's say it's OSX that's smart enough to respect that, and Windows doesn't give a sh*t. If I disable that I'm getting an error from the backend.

Screen Shot 2019-07-29 at 15 00 29

{
  "timestamp": "2019-07-29T14:00:20.849+02:00[Europe/Berlin]",
  "status": 500,
  "error": "Internal Server Error",
  "exception": "org.adempiere.exceptions.AdempiereException",
  "message": "IllegalArgumentException: new or null rowId is not accepted: null",
  "trace": [
    "org.adempiere.exceptions.AdempiereException: IllegalArgumentException: new or null rowId is not accepted: null",
    "\tat org.adempiere.exceptions.AdempiereException.wrapIfNeeded(AdempiereException.java:89)",
    "\tat org.adempiere.ad.trx.api.impl.AbstractTrxManager.call0(AbstractTrxManager.java:863)",
    "\tat org.adempiere.ad.trx.api.impl.AbstractTrxManager.call(AbstractTrxManager.java:687)",
    "\tat org.adempiere.ad.trx.api.impl.AbstractTrxManager.call(AbstractTrxManager.java:588)",
    "\tat org.adempiere.ad.trx.api.impl.AbstractTrxManager.call(AbstractTrxManager.java:519)",
    "\tat org.adempiere.ad.trx.api.impl.AbstractTrxManager.call(AbstractTrxManager.java:497)",
    "\tat org.adempiere.ad.trx.api.impl.AbstractTrxManager.call(AbstractTrxManager.java:474)",
    "\tat de.metas.ui.web.window.controller.Execution$ExecutionBuilder.lambda$execute$0(Execution.java:194)",
    "\tat de.metas.ui.web.window.controller.Execution$ExecutionBuilder.lambda$execute$2(Execution.java:237)",
    "\tat de.metas.ui.web.window.controller.Execution$ExecutionBuilder.execute(Execution.java:260)",
    "\tat de.metas.ui.web.window.controller.Execution.callInNewExecution(Execution.java:88)",
    "\tat de.metas.ui.web.quickinput.WindowQuickInputRestController.complete(WindowQuickInputRestController.java:327)",
    "\tat sun.reflect.GeneratedMethodAccessor436.invoke(Unknown Source)",
    "\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
    "\tat java.lang.reflect.Method.invoke(Method.java:498)",
    "\tat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)",
    "\tat org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)",
    "\tat org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)",
    "\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)",
    "\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)",
    "\tat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)",
    "\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)",
    "\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)",
    "\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)",
    "\tat org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)",
    "\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:661)",
    "\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)",
    "\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:742)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)",
    "\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat de.metas.ui.web.config.WebConfig$1.doFilter(WebConfig.java:82)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat de.metas.ui.web.config.ServletLoggingFilter.doFilter(ServletLoggingFilter.java:89)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat de.metas.ui.web.config.CORSFilter.doFilter(CORSFilter.java:79)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)",
    "\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)",
    "\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)",
    "\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)",
    "\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:167)",
    "\tat org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:80)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)",
    "\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)",
    "\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)",
    "\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)",
    "\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)",
    "\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)",
    "\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)",
    "\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)",
    "\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)",
    "\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)",
    "\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)",
    "\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)",
    "\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)",
    "\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)",
    "\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)",
    "\tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)",
    "\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)",
    "\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)",
    "\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)",
    "\tat java.lang.Thread.run(Thread.java:748)",
    "Caused by: java.lang.IllegalArgumentException: new or null rowId is not accepted: null",
    "\tat de.metas.ui.web.window.datatypes.DocumentPath.createChildPath(DocumentPath.java:424)",
    "\tat de.metas.ui.web.window.model.HighVolumeReadWriteIncludedDocumentsCollection.getDocumentById(HighVolumeReadWriteIncludedDocumentsCollection.java:205)",
    "\tat de.metas.ui.web.window.model.Document.getIncludedDocument(Document.java:1519)",
    "\tat de.metas.ui.web.quickinput.QuickInput.complete(QuickInput.java:249)",
    "\tat de.metas.ui.web.quickinput.WindowQuickInputRestController.lambda$null$9(WindowQuickInputRestController.java:329)",
    "\tat de.metas.ui.web.quickinput.WindowQuickInputRestController.lambda$forQuickInputWritable$3(WindowQuickInputRestController.java:230)",
    "\tat de.metas.ui.web.window.model.DocumentCollection.forRootDocumentWritable(DocumentCollection.java:308)",
    "\tat de.metas.ui.web.quickinput.WindowQuickInputRestController.forQuickInputWritable(WindowQuickInputRestController.java:223)",
    "\tat de.metas.ui.web.quickinput.WindowQuickInputRestController.lambda$complete$10(WindowQuickInputRestController.java:328)",
    "\tat org.adempiere.ad.trx.api.impl.TrxCallableWrappers$4.call(TrxCallableWrappers.java:193)",
    "\tat org.adempiere.ad.trx.api.impl.TrxCallableWrappers$5.call(TrxCallableWrappers.java:222)",
    "\tat org.adempiere.ad.trx.api.impl.AbstractTrxManager.call0(AbstractTrxManager.java:774)",
    "\t... 88 more",
    ""
  ],
  "path": "/rest//api/window/540322/1000037/AD_Tab-540779/quickInput/74/complete"
}

To actually add anything I have to add a legitimate row first. But then again I only get the required requests and everything works fine. I'm gonna try it on Windows, maybe that's the case.

https://recordit.co/ZJcQoe8Izh

@TheBestPessimist

This comment has been minimized.

Copy link
Member

commented Jul 29, 2019

This happens for me running on windows and using electron, not chrome. cypress version is 3.4.0

@TheBestPessimist

This comment has been minimized.

Copy link
Member

commented Jul 30, 2019

Tried with cypress 3.4.1 and it still fails.

Request 1:

image

Request 2:

image

@TheBestPessimist

This comment has been minimized.

Copy link
Member

commented Jul 30, 2019

Also retried with 3.3.2 and it still fails:

curl 'https://dev618.metasfresh.com/rest/api/window/540322/1000049/AD_Tab-540779/quickInput/90' -X PATCH       -H 'Referer: https://dev618.metasfresh.com/window/540322/1000049'   --data-binary '[{"op":"replace","path":"M_HU_PackingMaterial_ID","value":{"key":"3000989","caption":"Product1 30T07:51:54.024"}}]' 
curl 'https://dev618.metasfresh.com/rest/api/window/540322/1000049/AD_Tab-540779/quickInput/90' -X PATCH       -H 'Referer: https://dev618.metasfresh.com/window/540322/1000049'   --data-binary '[{"op":"replace","path":"Qty","value":"222"}]' 
curl 'https://dev618.metasfresh.com/rest/api/window/540322/1000049/AD_Tab-540779/quickInput/90' -X PATCH       -H 'Referer: https://dev618.metasfresh.com/window/540322/1000049'   --data-binary '[{"op":"replace","path":"Qty","value":""}]' 
curl 'https://dev618.metasfresh.com/rest/api/window/540322/1000049/AD_Tab-540779/quickInput/90/complete' -X POST     -H 'Accept: application/json, text/plain, */*'  -H 'Referer: https://dev618.metasfresh.com/window/540322/1000049'    

siemiatj added a commit that referenced this issue Jul 30, 2019

siemiatj added a commit that referenced this issue Jul 30, 2019

metas-ts added a commit to metasfresh/metasfresh that referenced this issue Aug 5, 2019

update ReleaseNotes.md
  * [#5411](#5411) Reset auth token for Json Reports user on each app-server-start
  * [#5382](#5382) Show reversal_id in advanced edit of empties return / receive
  * [#213](metasfresh/metasfresh-e2e#213) Reverse Empties Return
  * [#233](metasfresh/metasfresh-e2e#233) Change product prices and add a new one
  * [#2325](metasfresh/metasfresh-webui-frontend#2325) frontend patches too much in quick input field

@siemiatj siemiatj closed this Aug 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.