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: Remove lastSeenAt from useCollaborateData.tsx staleness check #4461

Merged
merged 6 commits into from
Aug 10, 2023

Conversation

andreas-unleash
Copy link
Contributor

@andreas-unleash andreas-unleash commented Aug 9, 2023

Remove the lastSeenAt property when checking for stale data

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
@vercel
Copy link

vercel bot commented Aug 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 10, 2023 0:35am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Aug 10, 2023 0:35am

if (Array.isArray(obj)) {
return obj.map(value => omitUnwantedData(value, field));
} else if (typeof obj === 'object' && obj !== null) {
const result: any = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason we're declaring the result object as const, as even though const Object and Arrays are mutable, but ideally should be declared as let/var when we're going to update/modify them as we do with other datatypes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When you declare a variable with const, it means that the variable itself cannot be reassigned to a new value. However, if the variable refers to an object or array, you can still modify the properties or elements within that object or array. The const keyword doesn't make the object itself immutable, just the variable reference.

Using const is often encouraged when a variable is not going to be reassigned because it communicates the intent more clearly and helps to prevent unintentional reassignments that could lead to bugs.

Copy link
Contributor

@kwasniew kwasniew left a comment

Choose a reason for hiding this comment

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

We need to add types and tests

frontend/src/hooks/useCollaborateData.tsx Outdated Show resolved Hide resolved
frontend/src/hooks/useCollaborateData.tsx Outdated Show resolved Hide resolved
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Copy link
Contributor

@kwasniew kwasniew left a comment

Choose a reason for hiding this comment

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

nice

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
# Conflicts:
#	frontend/cypress/integration/import/import.spec.ts
@andreas-unleash andreas-unleash merged commit 46314d2 into main Aug 10, 2023
15 checks passed
@andreas-unleash andreas-unleash deleted the fix/remove_lastSeenAt_from_staleness_check branch August 10, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants