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

We don't care about the timeline (just fire and forget to load the event) #2849

Closed

Conversation

MadLittleMods
Copy link
Contributor

@MadLittleMods MadLittleMods commented Nov 4, 2022

We don't care about the timeline (just fire and forget to load the event).

It's probably a misnomer to call it getEventTimeline(): timeline in the first place as it's more accurately used as loadEventInTimeline(): Promise<void> everywhere.

-- #2521 (comment)*

Split out from #2521

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

This change is marked as an internal change (Task), so will not be included in the changelog.

@MadLittleMods MadLittleMods added the T-Task Tasks for the team like planning label Nov 4, 2022
Comment on lines +140 to +142
await this.client.getEventTimeline(this.timelineSet, initialEventId)
.then(initFields);
return;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The function signature is Promise<void> here. We shouldn't return anything here.

Copy link
Member

@robintown robintown left a comment

Choose a reason for hiding this comment

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

I'm confused. It doesn't look like this changes any behavior?

Comment on lines -140 to 141
return this.client.getEventTimeline(this.timelineSet, initialEventId)
await this.client.getEventTimeline(this.timelineSet, initialEventId)
.then(initFields);
Copy link
Member

@robintown robintown Nov 4, 2022

Choose a reason for hiding this comment

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

this.client.getEventTimeline(...).then(initFields) was already a Promise<void>?

Copy link
Contributor Author

@MadLittleMods MadLittleMods Nov 4, 2022

Choose a reason for hiding this comment

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

Sorry, I think I confused my sentiment with this spot (which is totally different, oops) that I mentioned in #2521 (comment) with some blind copy-pasting out of that PR diff. I'm trying to get back to speed with everything going on in that stale PR.

And if we actually wanted to refactor to a fire and forget getEventTimeline pattern here, I'd need to adjust how initFields is done here.

I'll have a think on this one whether it's relevant. Good shout!

@MadLittleMods MadLittleMods changed the title We don't care about the timeline (just fire and forget) We don't care about the timeline (just fire and forget to load the event) Nov 4, 2022
@MadLittleMods MadLittleMods marked this pull request as draft November 4, 2022 08:17
@richvdh
Copy link
Member

richvdh commented Nov 4, 2022

removing review requests while this is in draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants