This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make
StreamToken.room_key
be aRoomStreamToken
instance. #8281Make
StreamToken.room_key
be aRoomStreamToken
instance. #8281Changes from all commits
86dfefd
2352b05
e92ad19
79f7412
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Was
get_new_events
always expecting an int? I'm not sure I understand this change.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.
Ah, sorry, I noticed this as part of some mypy fun and forgot about it. Basically
since_token.typing_key
is now anint
so this is "just" fixing the ternary to return a consistent typeThere 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.
Is the plan to eventually move all of these over to
RoomStreamToken
or?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.
Ugh, so, argh. I spent some time trying to figure out what to do here, but basically we have a problem where the type of
stream_id
depends on the stream_key value. Adding overrides with literals sort works for the top level, but those functions then can't call other functions with literal overrides.I think it may be possible to convert these into full
StreamTokens
with a bit of rejigging thoughThere 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 see. If this gets more complicated it might make sense to make a type that represents this (
StreamToken = Union[int, RoomStreamToken, FutureStreamToken]
).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.
FWIW the new stuff will just be buried in
RoomStreamToken
so I'm hoping we don't see any more types for now. The big thing will be if we add types to the other streamsThere 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.
This is what I meant, yep!