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

Stop event editor from breaking in dev #3665

Merged

Conversation

ivarnakken
Copy link
Member

@ivarnakken ivarnakken commented Mar 11, 2023

Description

There was problems with storing non-serializable moment objects in the redux store. Issue is fixed by turning event dates into ISO strings.

Multiple places used the dates directly as moment objects, which now needs to be wrapped in a moment() function. This is the way it's done elsewhere in our codebase.

Result

Screen.Recording.2023-03-11.at.18.08.29.mov

Testing

  • I have thoroughly tested my changes.

See video above.

More testing is needed, as I was experiencing some weird behaviour.

Pages will crash if you try to perform moment related functions on a string, so I need to make sure there's no such thing left.

@ivarnakken ivarnakken added review-needed Pull requests that need review bug-fix Pull requests that fix a bug testing-needed Pull requests that need testing, e.g. stress tests by users or specs labels Mar 11, 2023
@ivarnakken ivarnakken self-assigned this Mar 11, 2023
@linear
Copy link

linear bot commented Mar 11, 2023

ABA-323 Not possible to edit events in dev

kinda possible, if you wait a couple of seconds … very weird behaviour

@ivarnakken ivarnakken force-pushed the ivarnakken/aba-323-not-possible-to-edit-events-in-dev branch from 2708347 to c902c63 Compare March 11, 2023 17:11
There was problems with storing non-serializble moment objects
in the redux store. Issue is fixed by turning event dates into ISO strings.
@ivarnakken ivarnakken force-pushed the ivarnakken/aba-323-not-possible-to-edit-events-in-dev branch from c902c63 to a144eed Compare March 12, 2023 16:30
Copy link
Contributor

@erlingfn erlingfn left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -208,7 +208,9 @@ export const selectUpcomingEvents = createSelector(selectEvents, (events) =>
events.filter((event) => event.isUsersUpcoming)
);
export const selectSortedEvents = createSelector(selectEvents, (events) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be out of scope, but could it be possible to add some types to these functions, to make it easier to maintain in the future?

app/routes/events/utils.ts Show resolved Hide resolved
Copy link
Member

@eikhr eikhr left a comment

Choose a reason for hiding this comment

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

nice!

@LudvigHz LudvigHz merged commit e0e31f6 into master Mar 13, 2023
@LudvigHz LudvigHz deleted the ivarnakken/aba-323-not-possible-to-edit-events-in-dev branch March 13, 2023 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix Pull requests that fix a bug review-needed Pull requests that need review testing-needed Pull requests that need testing, e.g. stress tests by users or specs
Projects
None yet
4 participants