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

Event callbacks are processed in LIFO order given a backlog of messages #78

Open
cursork opened this issue Dec 2, 2024 · 2 comments
Open

Comments

@cursork
Copy link
Contributor

cursork commented Dec 2, 2024

Log of Rs and Ts:

08:27.194 R:  #2: {"Event":{"EventName":"KeyPress","ID":"F1.E","EventID":"b8ae1f33-0fe2-4798-ad71-0fbd950bf842","Info":["f",102,70,0]}} 
08:27.311 R:  #2: {"Event":{"EventName":"KeyPress","ID":"F1.E","EventID":"2d359cc6-289d-4ae1-a896-0fc935903ac9","Info":["l",108,76,0]}} 
08:27.553 R:  #2: {"Event":{"EventName":"KeyPress","ID":"F1.E","EventID":"f93c8db8-7abc-4aff-a161-91897149590b","Info":["i",105,73,0]}} 
08:27.658 R:  #2: {"Event":{"EventName":"KeyPress","ID":"F1.E","EventID":"89c92073-7e7c-44fc-a73d-abdb0533625d","Info":["p",112,80,0]}} 
08:28.228 T:  #2: {"EC":{"EventID":"b8ae1f33-0fe2-4798-ad71-0fbd950bf842","Proceed":1}} 
08:29.252 T:  #2: {"EC":{"EventID":"89c92073-7e7c-44fc-a73d-abdb0533625d","Proceed":1}} 
08:30.279 T:  #2: {"EC":{"EventID":"f93c8db8-7abc-4aff-a161-91897149590b","Proceed":1}} 
08:31.301 T:  #2: {"EC":{"EventID":"2d359cc6-289d-4ae1-a896-0fc935903ac9","Proceed":1}} 

Repro is simply:

'F1'eWC'Form'
'F1.E'eWC'Edit'('Posn' 10 10)('Size' 12 100)('Event' 'KeyPress' 'CBKP')

where CBKP is just a ⎕DL 1 and nothing else.

The messages for the word 'flip' arrive in order (EventIDs starting with) b8, 2d, f9, 89 but Proceeds are issued in the order b8, 89, f9, 2d. While the first one is in its callback waiting on the DL, the others form a backlog.

I believe they must be in the same order? If not, then I believe the client needs to be smarter on this front.

Tested on both main and fix-65-dq.

@cursork cursork changed the title Events are processed in LIFO order given a backlog of messages Event callbacks are processed in LIFO order given a backlog of messages Dec 2, 2024
@cursork
Copy link
Contributor Author

cursork commented Dec 2, 2024

To clarify what I meant here, I believe the two options are based on whether the client should be able to proactively queue more than one event or not:

  • The server must always process events in order per connection.
  • The client must always wait for an event response (when required) before the next event is emitted.

It is also possible to do both, as they are not mutually exclusive. However, one negates the necessity of the other, in theory.

@cursork
Copy link
Contributor Author

cursork commented Dec 2, 2024

eDQ 'F1' works

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

1 participant