SambaPOS 5.1.60 Release

I’m actually working on a custom web app that uses the ticket tags to store additional ticket data. The web app integrates with a number of other non-samba related services, so I prefer to not implement it natively within Samba. Thanks!

Hmm I think you should start a new thread and be sure and share any information like that so we can focus our help. Its hard to know what your trying to do sometimes if you dont explain that.

This is strange:

mutation m { executePrintJob(name: “Orders to Kitchen”, ticketId: 3740, orderStateFilters: [{stateName: “Status”, state: “New”}], nextOrderStates:[{stateName:“Status”,currentState:“New”,state:“Submitted”}]) { name } }

sometimes replies with a success JSON, and sometimes it does not.
Even when the return JSON shows success, nothing is printed, and the order states are not updated either.
Out of countless tests, i had one successful print, and the very same query with a new ticket ID failed.

Trying in the GraphiQL window, the loader is spinning for ever.

Hi, some questions here:

So after I tried setting messaging server port to “8383+” on MessagingServerServiceTool, now another PC will not connect to messaging server unless I add additonal firewall to whitelist 8383 port inbound, then it will work.

This is weird because in the previous ‘non-GraphQL version’ I only need to white-list MessagingServerServiceTool and call it a day. Any particular reason why this is the case?

Here’s the annotated picture for what I mean:

Another weird behaviour I noticed is:

  1. Once you tried setting the port with GraphQL enabled (E.g. 8383+), you can never turn that feature off again on MessagingServerServiceTool.exe (i.e. you can’t revert the port back to 8383) even if the service is stopped and uninstalled (normal 8383 port on MessagingServer.exe works fine, however)

There are two message server implementations. By adding + to port number new signalr based implementation starts working to allow messaging between SambaPOS and HTML apps. It also starts serving html apps through that port. That’s why that additional configuration is needed.

2 Likes

Hi @emre

Im not sure yet, but i think there are issues with the Execute Print Command.
90% of the times i get ‘Error trying to resolve executePrintJob’. Every once in a while, everything goes well…
Is there something im missing?
here is my flow:

  1. Check if customer exists. If not, create
  2. Create Ticket
  3. Print Orders to kitchen.

I printed out the query to test in the Graphiql browser view, same thing there… works sometimes, but mostly does not.
There are times when i’ve had to restart the samba message service. So i need to isolate and figure out what is causing this. Its an integration with a website. Having most of the orders fail because of a print job execution can be very problematic to organise with. The kitchen will lose track.

By the way, any proper update on how to update/edit entity(Customer profile) via this API ?

Hard to help without seeing your code honestly. GraphQL has been rock solid in my tests even faster than sambapos itself often.

However I now do not directly create orders. I am using the terminal tickets via GraphQL and letting sambapos handle the prints and automation.

Edit: you may not be in beta to know what I am talking about. Are you interested in beta and helping us test and shape this api?

If your in beta You should follow the PMPOS thread we discuss most of this stuff there. Also you can fork the code and see it yourself.

Are you in beta? The api was released as is for experiments and testing. A lot is changing with how we are using it. Most of that discussion is in beta team atm.

well the code being sent really is just:

mutation m { executePrintJob(name: “Orders to Kitchen”, ticketId: 3740, orderStateFilters: [{stateName: “Status”, state: “New”}], nextOrderStates:[{stateName:“Status”,currentState:“New”,state:“Submitted”}]) { name } }

In the Graphiql server at localhost:9000
works pretty much 1/10 times…9/10 times its spinning forever with no error in console.

Same thing when i script is called via JS on my website.
Create Customer, Create Ticket all work perfectly though.

1 Like

Did you add + when setup messenger service

I always get error tho. “An argument with name "terminal" does not exist.” don’t know where to set that.

{
  "data": {
    "executePrintJob": null
  },
  "errors": [
    {
      "ClassName": "GraphQL.ExecutionError",
      "Message": "Error trying to resolve executePrintJob.",
      "Data": null,
      "InnerException": {
        "ClassName": "GraphQL.ExecutionError",
        "Message": "An argument with name \"terminal\" does not exist.",
        "Data": null,
        "InnerException": null,
        "HelpURL": null,
        "StackTraceString": "   at GraphQL.Types.ResolveFieldContext.Argument[TType](String name)\r\n   at Samba.Services.Graphql.Builders.AppStateBuilder.GetAppState(ResolveFieldContext context)\r\n   at Samba.Services.Graphql.Printing.PrintingMutation.PrintTicket(ResolveFieldContext arg, Int32 copies, PrintJob printJob, Nullable`1 ticketId)\r\n   at Samba.Services.Graphql.Printing.PrintingMutation.ExecutePrintJob(ResolveFieldContext arg)\r\n   at GraphQL.DocumentExecuter.<ResolveFieldAsync>d__8.MoveNext()",
        "RemoteStackTraceString": null,
        "RemoteStackIndex": 0,
        "ExceptionMethod": "8\nArgument\nGraphQL, Version=0.11.0.493, Culture=neutral, PublicKeyToken=null\nGraphQL.Types.ResolveFieldContext\nTType Argument[TType](System.String)",
        "HResult": -2146233088,
        "Source": "GraphQL",
        "WatsonBuckets": null
      },
      "HelpURL": null,
      "StackTraceString": null,
      "RemoteStackTraceString": null,
      "RemoteStackIndex": 0,
      "ExceptionMethod": null,
      "HResult": -2146233088,
      "Source": null,
      "WatsonBuckets": null
    }
  ]
}

You set that in the GQL Mutation. Show the mutation you use to invoke the Print Job.

I just test this script which digithai said it spin forever. I’m not sure if this GQL Mutation you asking?

mutation m { executePrintJob(name: "Orders to Kitchen", ticketId: 3740, orderStateFilters: [{stateName: "Status", state: "New"}], nextOrderStates:[{stateName:"Status",currentState:"New",state:"Submitted"}]) { name } }

Hmm… I know I have seen that error before and thought I had a fix for it.

@emre, I think this is a bug, either way.

@qmckay remember he is on an older version its likely .61 has fixed that. Have we tested it on the latest beta?

I’m testing on 61 (downloaded 2 days ago).

I don’t think the error is in .60 … I remember executing that mutation and it used to work, but only for certain printer Types (ie. Custom Printers like the Task Printer did not work).

The error message appears in the .61 beta, and I thought I found a workaround for it, but apparently not. I forgot to report it, but it was moot to me since in .61 Print Rules fire via Automation anyway, so I had no need for that mutation any longer.

Thank you very much for letting me know that.

It is not required for all prints but we need to enter user name, terminal name or ticket type to be able to make some custom printers work. I think I should configure them as optional parameters. It should work fine on next update.

4 Likes

i got message": "Authorization has been denied for this request when trying to access GQL

where should set Authorization? my OS WIN 10.

thank you

You have to login once first. http://192.168.1.104:9000/login
Username: Admin
Password: password

After enter it seem nothing happen but it works.

after try login, then manually back to 192.168.1.104 , because no htpp redirect ,
i got this following error again,

{
“message”: “An error has occurred.”,
“exceptionMessage”: “Value cannot be null.\r\nParameter name: source”,
“exceptionType”: “System.ArgumentNullException”,
“stackTrace”: " at System.Linq.Enumerable.SkipWhile[TSource](IEnumerable1 source, Func2 predicate)\r\n at Samba.MessagingServer.WindowsService.GraphqlController.d__3.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Threading.Tasks.TaskHelpersExtensions.d__3`1.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()"
}

it`s seems token create only in local browser not return from server,
MoveNext()\r\n— End of stack trace from previous location where exception was thrown