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

API fix: with_query_tag()/without_query_tag() #555

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

fantix
Copy link
Member

@fantix fantix commented Dec 3, 2024

No description provided.

def with_query_tag(self, tag: str):
for prefix in ["edgedb/", "gel/"]:
if tag.startswith(prefix):
raise errors.InvalidArgumentError(f"reserved tag: {prefix}*")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just a warning? The server should ideally just silently ignore them

Copy link
Member Author

@fantix fantix Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the same, but we will send e.g. gel/repl tags from the CLI or gel/ui from the UI/JS client, while the server has no knowledge about the peer identity; the server could also receive myapp/financial-queries equally, so it just records the tags as received without ignoring. Unless you meant to reserve gel/* for only server-internal queries like in some table GC tasks (instead of queries over the binary protocol), adding an error in client bindings is the last chance we can enforce exclusiveness on this tag namespace.

Comment on lines +421 to +424
if len(tag) > 128:
raise errors.InvalidArgumentError(
"tag too long (> 128 characters)"
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we check this server-side also?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we do!

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

Successfully merging this pull request may close these issues.

3 participants