codepod icon indicating copy to clipboard operation
codepod copied to clipboard

dashboard not automatically refreshed

Open forrestbao opened this issue 1 year ago • 5 comments

If I create a new repo, and click "Codepod" in the breadcrumbs to navigate back to the dashboard, the new repo will not appear on my dashboard until I manually fresh (via the browser) the dashboard page. I am not sure whether we do not have autorefresh or the auto-refresh frequency is too low. But at least every time I access it.

forrestbao avatar Jul 21 '23 03:07 forrestbao

Yes, I'm aware of this. This is a bug somewhere in React re-rendering logic. It should be instantly refreshed.

lihebi avatar Jul 21 '23 14:07 lihebi

i can take a look

sumtsui avatar Jul 23 '23 15:07 sumtsui

PR #422 should fix the issue

senwang86 avatar Aug 03 '23 18:08 senwang86

#422 doesn't fix this issue. (And #422 introduced a regression, fixed in #425).

This issue is weird, it works well (to refresh the dashboard) in the local development env, but doesn't work on the production server.

lihebi avatar Aug 04 '23 02:08 lihebi

Possible solutions:

  1. use the full query {query: ..., variables: ...} instead of the string "GetDashboardRepos" in the refetchQueries option. Ref: https://github.com/apollographql/apollo-client/issues/5419#issuecomment-598065442
  2. update GraphQL cache manually instead of relying on refetchQueries, similar to what Haochen did in https://github.com/codepod-io/codepod/pull/364#discussion_r1257722308

lihebi avatar Aug 04 '23 21:08 lihebi