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

oh-repeater rulesWithTags does not work with multiple tags #2181

Open
m4rcu5 opened this issue Nov 22, 2023 · 0 comments
Open

oh-repeater rulesWithTags does not work with multiple tags #2181

m4rcu5 opened this issue Nov 22, 2023 · 0 comments
Labels
bug Something isn't working main ui Main UI

Comments

@m4rcu5
Copy link

m4rcu5 commented Nov 22, 2023

The problem

When filtering on multiple tags, by defining them as a comma separated list, as suggested by the oh-repeater documentation, there are no results returned.

Expected behavior

The expected return are all rules that match the combination of tags specified.

Steps to reproduce

- component: oh-repeater
  config:
    for: scene
    sourceType: rulesWithTags
    ruleTags: TagA,TagB

Results in the following API call:
GET /rest/rules?summary=true&tags=TagA,TagB

Which does not return rules (scenes in my case) tagged with both TagA and TagB, but no results at all.

If only a single tag is specified this works as documented.

Your environment

runtimeInfo:
  version: 4.0.4
  buildString: Release Build

Additional information

Looking at the initial PR for this feature (#1724), it seems that the rulesWithTags is implemented the same way as itemsWithTags. However when looking into the API exporer to build these backend calls by hand, they seem to differ.

Example for items with multiple tags, which indeed seems to use coma separation: /rest/items?tags=Measurement,Level

Example for rules, which seems to expect the same query parameter multiple times: /rest/rules?tags=Scene&tags=TagA&tags=TagB

Doing a bit of query injection in the oh-repeater seems to confirm this suspicion.

- component: oh-repeater
  config:
    for: scene
    sourceType: rulesWithTags
    ruleTags: 'TagA&tags=TagB'

Returns the expected results, and the following API call:
GET /rest/rules?summary=true&tags=TagA&tags=TagB

@m4rcu5 m4rcu5 added bug Something isn't working main ui Main UI labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

No branches or pull requests

1 participant