-
Notifications
You must be signed in to change notification settings - Fork 14
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: Make our app automatically aware of new Colony Contributors #3801
base: master
Are you sure you want to change the base?
Conversation
b8b9482
to
f83d288
Compare
@@ -119,7 +120,7 @@ const MemberContextProvider: FC<PropsWithChildren> = ({ children }) => { | |||
data: memberSearchData, | |||
loading, | |||
fetchMore, | |||
refetch, | |||
refetch: refetcColonyContributors, |
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.
refetcH
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!
f83d288
to
a949d7a
Compare
a949d7a
to
fac70af
Compare
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.
Hey @rumzledz , thank you for this nice fix ✨
Simple payments works as expected 🙌
However on Members page the Followers count was not updated:
And dashboard members count was not updated as well:
Thank you!
Those are irrelevant to the raised issue but sure, I'll fix it too 😂 |
@Nortsova There! Irrelevant fix pushed 😂 🚀 |
let timeout: NodeJS.Timeout; | ||
|
||
if (newColonyContributor) { | ||
// It looks hacky, but we need the timeout to ensure that opensearch has been updated before we refetch. |
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.
I know this fixes such a small edge case that it doesn't really matter too much, but is a 2000
timeout reliable for opensearch having updated? Does it reliably take less than 2 seconds?
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.
Hey @iamsamgibbs ! I tried to do 1 second and was able to notice an issue in like 1 out of 10 times. But I never had an issue with 2, so I stuck with 2, which also aligns with the colony contributor refetch done on the MemberContextProvider. There’s also a little loading window before the user gets to the colony after joining so it shouldn’t be too much of an issue 😄
Description
Issue #3622 is a bit misleading. It's not that the app doesn't ever show the new contributor. It's just that on
master
, you'd have to reload the app to make our app refetch our contributors list.So I added a subscription logic to make the app automatically aware that a new contributor has been added to a Colony.
And the result is nothing short of spectacular ✨
Testing
node scripts/create-colony-url.js
colonyMemberInviteCode
field value i.e."cb488112-49af-4fd8-a666-5a3c71d35f1e"
Resolves #3632