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

Quotes not working in q/mq filter in subscriptions #2995

Closed
fgalan opened this issue Oct 5, 2017 · 5 comments
Closed

Quotes not working in q/mq filter in subscriptions #2995

fgalan opened this issue Oct 5, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@fgalan
Copy link
Member

fgalan commented Oct 5, 2017

Situation:

Having this subscription in place:

{
    "id": "59d61559b473c61d5aa8763e",
    "notification": {
        "attrs": [
            "t"
        ],
        "attrsFormat": "normalized",
        "http": {
            "url": "http://10.x.x.x:10031/notify"
        },
        "lastNotification": "2017-10-05T11:29:00.00Z",
        "lastSuccess": "2017-10-05T11:29:00.00Z",
        "timesSent": 2
    },
    "status": "active",
    "subject": {
        "condition": {
            "attrs": [
                "t"
            ],
            "expression": {
                "q": "t.'a.b'.'c.d'>=20"
            }
        },
        "entities": [
            {
                "idPattern": ".*"
            }
        ]
    }
}

And this entity:

{
        "id": "E1",
        "type": "T",
        "t": {
            "metadata": {},
            "type": "StructuredData",
            "value": {
                "a": {
                    "b": {
                        "c": {
                            "d": 100
                        }
                    }
                }
            }
        }
}

Bug:

  • Each time a.b.c.d is updated with, a notification is sent (i.e. timesSent increments). Thus, the 'a.b'.'c.d'>=20 filtering is not being honoured (as it was a.b.c.d>=20)
  • Moreover, it seems that the notification takes place always, no matter if the value is greater, equal or less than 20 and no matter if there is an actual change or not (i.e. two consecutuive updates with for instance 20 trigger a notification each one)
@fgalan fgalan added the bug label Oct 5, 2017
@fgalan
Copy link
Member Author

fgalan commented Oct 5, 2017

I haven't checked but it may impact also to "mq" in subscriptions

@fgalan
Copy link
Member Author

fgalan commented Oct 5, 2017

Related with #2805 functionality. Have a look to cases/2805 in order to see if we have this scenario covered.

@fgalan
Copy link
Member Author

fgalan commented Oct 5, 2017

Loking into cases/2805 we have two test cases: quotes_in_lhs_compound_of_string_filter.test and quotes_in_lhs_of_string_filter.test. They cover GET functionality, but not subscriptions.

Some .test for subscriptions should be added, based in the same cases in the aforementioned .test in order to guide the fix of this bug. Maybe only a subset, given that they include many cases.

@fgalan fgalan added this to the 1.9.0 milestone Oct 5, 2017
@fgalan
Copy link
Member Author

fgalan commented Oct 5, 2017

It seems the same problem occurs with mq for metadata filters.

@fgalan fgalan changed the title Quotes not working in q filter in subscriptions Quotes not working in q/mq filter in subscriptions Oct 5, 2017
@fgalan fgalan modified the milestones: 1.9.0, 1.10.0 Oct 19, 2017
@fgalan
Copy link
Member Author

fgalan commented Nov 3, 2017

Fixed by PR #3031

@fgalan fgalan closed this as completed Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants