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

The RpcClient class attribute, "requests", is not flushed after the call to execute() #4

Closed
tandem5 opened this issue May 2, 2020 · 1 comment
Assignees

Comments

@tandem5
Copy link

tandem5 commented May 2, 2020

Requests will accumulate between sequential calls from the same RPCClient instantiation. Moreover an illegal string offset warning will occur if a single request (non-batch) is made first. The warning is derived from the first, single request being classified as non-batch and thus the elements of the encapsulated array are elevated to the parent array of "requests." When the second request is made, because "requests" is still populated, it is interpreted as batch. The batch method will then tokenize mixed elements including strings and interpret them as arrays.

I suggest flushing the "requests" attribute after the "options" array is defined in the "request" method.

@abraovic abraovic self-assigned this May 2, 2020
abraovic added a commit that referenced this issue May 2, 2020
@abraovic
Copy link
Collaborator

abraovic commented May 2, 2020

Thanks for that suggestion @tandem5. I have pushed a new commit as suggested.

@abraovic abraovic closed this as completed May 2, 2020
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

2 participants