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

FIX: Refresh logic in discovery topic lists #15489

Merged
merged 1 commit into from Jan 7, 2022

Conversation

davidtaylorhq
Copy link
Member

Before 6e0e601, the flow looked something like:

  1. discovery/topics controller (which extends discovery controller) afterRefresh() calls .send("loadingComplete")
  2. Bubbles to discovery route
  3. Discovery route calls controllerFor('discovery').loadingComplete(). loading is set false, and the spinner disappears

Now that discovery/topics defines loadingComplete as an action, the discovery/topics controller runs its own loadingComplete handler logic in step 1, and the action does not bubble any further.

This commit adds action overrides in discovery/topics, so that the new actions only apply to the main discovery controller. The need for this does suggest some more radical refactoring is required, but these are very critical routes, and we are very close to a major release.

Meta topic: https://meta.discourse.org/t/topic-list-loads-forever-in-some-circumstances/214042

Before 6e0e601, the flow looked something like:

1. `discovery/topics` controller (which extends `discovery` controller) `afterRefresh()` calls `.send("loadingComplete")`
2. Bubbles to [`discovery` route](https://github.com/discourse/discourse/blob/554ff07786a81ed55c902c074d5ba787cfda0a3b/app/assets/javascripts/discourse/app/routes/discovery.js#L58)
3. Discovery route calls `controllerFor('discovery').loadingComplete()`. `loading` is set false, and the spinner disappears

Now that `discovery/topics` defines `loadingComplete` as an action, the `discovery/topics` controller runs its own `loadingComplete` handler logic in step 1, and the action does not bubble any further.

This commit adds action overrides in `discovery/topics`, so that the new actions only apply to the main `discovery` controller. The need for this does suggest some more radical refactoring is required, but these are very critical routes, and we are very close to a major release.
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/topic-list-loads-forever-in-some-circumstances/214042/5

@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/clicking-on-logo-from-default-page-view-fails-to-load-page/214029/6

@davidtaylorhq davidtaylorhq merged commit f94c01b into main Jan 7, 2022
@davidtaylorhq davidtaylorhq deleted the discovery-topics-refresh branch January 7, 2022 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants