-
Notifications
You must be signed in to change notification settings - Fork 46
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
base: master
Are you sure you want to change the base?
Conversation
def with_query_tag(self, tag: str): | ||
for prefix in ["edgedb/", "gel/"]: | ||
if tag.startswith(prefix): | ||
raise errors.InvalidArgumentError(f"reserved tag: {prefix}*") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
if len(tag) > 128: | ||
raise errors.InvalidArgumentError( | ||
"tag too long (> 128 characters)" | ||
) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we do!
No description provided.