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

agent.addListener works intermitently? #172

Open
mixmix opened this issue Feb 9, 2024 · 5 comments
Open

agent.addListener works intermitently? #172

mixmix opened this issue Feb 9, 2024 · 5 comments

Comments

@mixmix
Copy link

mixmix commented Feb 9, 2024

Is this a regression?

Yes

Description

Listening with agent.addListener('message', cb) for thid + piuri:

  0e9722e7-4eb6-4ec1-80d3-e50763621ba4 https://didcomm.org/issue-credential/3.0/issue-credential

Arrived:

✗ 8593b398-0cb2-4a73-8a09-7340dfa8b84f https://didcomm.org/issue-credential/3.0/offer-credential
(timeout after 60 seconds of waiting)

But what's this....messages found with agent.pluto.getAllMessages:

[
  '66e60595-c9a0-4a54-a34f-efb1b5c59dbe https://atalaprism.io/mercury/connections/1.0/request',
  '0e9722e7-4eb6-4ec1-80d3-e50763621ba4 https://didcomm.org/issue-credential/3.0/request-credential',
  '0e9722e7-4eb6-4ec1-80d3-e50763621ba4 https://didcomm.org/issue-credential/3.0/issue-credential', // <<<
  'cad05301-56e1-41cf-b578-bd479631ffa7 https://atalaprism.io/mercury/connections/1.0/request',
  '0e9722e7-4eb6-4ec1-80d3-e50763621ba4 https://didcomm.org/issue-credential/3.0/offer-credential',
  '66e60595-c9a0-4a54-a34f-efb1b5c59dbe https://atalaprism.io/mercury/connections/1.0/response',
  '0e9722e7-4eb6-4ec1-80d3-e50763621ba4 https://didcomm.org/issue-credential/3.0/request-credential',
  'cad05301-56e1-41cf-b578-bd479631ffa7 https://atalaprism.io/mercury/connections/1.0/response',
  '8593b398-0cb2-4a73-8a09-7340dfa8b84f https://didcomm.org/issue-credential/3.0/offer-credential'
]

Match is seen as 3rd entry in Array

Please provide the exception or error you saw

Not an exception, was just expecting an new matching "Messsage" to trigger.

Interestingly I see this one test working in a particular test, but when I run a suite of tests (in series) what I see is this test failing (it runs after another test... but the location of the tests paths should be different and the runs should be clean...)

Please provide the environment you discovered this bug in

No response

Anything else?

Here's what it looks like with events when this test is run in isolation:

Listening with agent.addListener('message', db) for thid + piuri:

      0b5a2790-1342-43a4-b36d-3ab5b08d8ce3 https://didcomm.org/issue-credential/3.0/issue-credential

Arrived:

    ✗ 0b5a2790-1342-43a4-b36d-3ab5b08d8ce3 https://didcomm.org/issue-credential/3.0/offer-credential
    ✓ 0b5a2790-1342-43a4-b36d-3ab5b08d8ce3 https://didcomm.org/issue-credential/3.0/issue-credential

Yay! it arrived here

@elribonazo
Copy link
Contributor

@mixmix can u show me how are you doing the listening part in your tests?

I wonder if you are really listening to 1 listener or multiple ones and whats going on.

@elribonazo
Copy link
Contributor

are u calling agent stop by any change after each test runs?

@mixmix
Copy link
Author

mixmix commented Mar 19, 2024

No. This is in 4.0.2

i have just coded to give up on the listener after 60s, then search for the message via pluto.getAllMessages, match on piuri + thid and it' ALWAYS there 😅

@mixmix
Copy link
Author

mixmix commented Mar 19, 2024

@mkbreuningIOHK
Copy link
Contributor

@mixmix , could you tell if this issue is still applicable as it's been more than a month without an update. cc @elribonazo

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

3 participants