Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix docstring in EventContext #14145

Merged
merged 2 commits into from
Oct 18, 2022
Merged

Fix docstring in EventContext #14145

merged 2 commits into from
Oct 18, 2022

Conversation

H-Shay
Copy link
Contributor

@H-Shay H-Shay commented Oct 11, 2022

Based on the other comments I think this is what was meant? Otherwise it doesn't make sense.

@H-Shay H-Shay requested a review from a team as a code owner October 11, 2022 19:09
Comment on lines +68 to +69
If the event is a state event, this is normally the same as
``state_group_before_event``.
Copy link
Contributor

Choose a reason for hiding this comment

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

Above, it says

        state_group_before_event: ...
            .... If
            it's a state event, it will be the same as ``prev_group``.

so I think your interpretation is right, though I wonder why this says 'normally' the same?
I'd be tempted to suggest finding out why from someone who knows and documenting the circumstance in which it isn't, or given that the above documentation for state_group_before_event says that it will be the same, just striking out normally altogether.

Copy link
Member

Choose a reason for hiding this comment

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

I can't think of any cases where they will be different.

Copy link
Member

Choose a reason for hiding this comment

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

I'm a little bit hesitant to guarantee behaviour in docstrings like that, its not obvious to me that there is any reason why its useful to have a guarentee like that?

In particular, I've in the past toyed with the idea that prev_group for state events should not necessarily match that of state_group_before_event, and instead point to a state group of one of the events prev events. This might help with caches that have optimisations for when they've got a cached result for prev_group, in such cases they will almost never have a cached result for state_group_before_event when there has been a state resolution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like it makes sense to merge the change as is then?

@H-Shay H-Shay merged commit 1c777ef into develop Oct 18, 2022
@H-Shay H-Shay deleted the shay/fix_comment branch October 18, 2022 20:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants