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

NGSILD-Results-Count of subscriptions is always n+1 #1647

Open
djs0109 opened this issue Jul 23, 2024 · 2 comments
Open

NGSILD-Results-Count of subscriptions is always n+1 #1647

djs0109 opened this issue Jul 23, 2024 · 2 comments
Assignees
Labels
invalid This doesn't seem right Need more input

Comments

@djs0109
Copy link

djs0109 commented Jul 23, 2024

Description

Hi, I found that if set count=true in parameters, the NGSILD-Results-Count of subscriptions is always n+1, where n is the number of existing subscriptions, as least of what users can see.

To reproduce

Orion-LD version: 1.4.0

Send a GET request to an empty tenant (I am using default one) with count=true

curl --location 'http://<orion-ld>:1027/ngsi-ld/v1/subscriptions?count=true' \
--header 'Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'

Then you will see the NGSILD-Results-Count is 1 instead of 0.

After posting one subscription and repeating the above step again, you will see NGSILD-Results-Count change to 2.

Expectation

A bug fix or if this is the expected behavior, maybe mention this somewhere in the documentation.

@kzangeli kzangeli self-assigned this Sep 4, 2024
@kzangeli kzangeli added the invalid This doesn't seem right label Sep 4, 2024
@kzangeli
Copy link
Collaborator

kzangeli commented Sep 4, 2024

I implemented a functional test doing the following:

01. GET all subscriptions, with count set - see 0 and []
02. Create subscription urn:S1
03. GET all subscriptions, with count set - see 1 and urn:S1
04. GET all subscriptions, with count set and limit=0- see 1 and []

It worked like a charm.
Are you sure you don't have some old subscription in your DB that you aren't counting with?

And if not, I can not reproduce the error. I'll need more input.

@djs0109
Copy link
Author

djs0109 commented Sep 5, 2024

Hi, thank you for having a check! I have restarted the stack, and since then I am not able to reproduce this error either. Therefore, we could probably close this issue for now. If this problem occur later again, I can surely provide more information here and reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right Need more input
Projects
None yet
Development

No branches or pull requests

2 participants