-
Notifications
You must be signed in to change notification settings - Fork 114
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
✏️📖 Diary Services Rewrite #1085
✏️📖 Diary Services Rewrite #1085
Conversation
diaryHelper now only uses luxon, and does not rely on the momentjs library.
…-mission-phone into diaryServices-rewrite Keeping code up to date, enable Prettier
- moved functions to timelineHelper - updated momentJS code to luxon
Update: All of the service rewrites seem to be working correctly, I'm now working on writing tests! The current issue I've run into is that That being said, should I be focusing on replacing the Edit: Theoretically, we should be able to use the Ionic Loader without Angular (docs): with some quick tests, this doesn't seem to be working. Is this because the version we use with angular is Ionic v1.3.3? I'm mostly thinking out loud in this edit, I'll keep looking into using the loader in react! |
Yes! Replace if possible! We want to be done with Angular and move on to new things (for the record we are using Angular 1.6.7 I believe, which is not what Ionic ships with but it was necessary to upgrade to be able to interop with React) |
I would suggest handling the "loading" popup in the thing that calls
At least for now until we (potentially) implement a 'global' popup mechanism |
- Behavior remains unchanged when removing this component - labelTab and other parent components handle loading, so the ionic service is not needed.
- Added test for each diaryService rewrite
Updated for changes
Tests and mocks are done - currently brainstorming more effective ways to test beyond |
- borrowed the windowAlert mocks from PR e-mission#1093, to allow error checking - added mockCheck, updated some tests to use to `toEqual()`
I had two questions about this PR's current unit tests:
|
- wrap the tests related to unprocessed inputs in a describe(...) - on the other mocks in this file, fallback to the original implementation - ensure both updateAllUnprocessedInputs and updateLocalUnprocessedInputs are used - tidy up the mock configs
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## service_rewrite_2023 #1085 +/- ##
=========================================================
+ Coverage 58.83% 73.95% +15.12%
=========================================================
Files 26 27 +1
Lines 1421 1701 +280
Branches 320 356 +36
=========================================================
+ Hits 836 1258 +422
+ Misses 585 443 -142
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This was caused by missing parentheses - instead of passing the result of toISO(), we were passing the toISO function itself!
@the-bay-kay this now has a merge conflict, can you please resolve? |
I just merged the changes, but ended up losing this change since it was overridden by the switch to luxon. |
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.
Almost there, just some high-level questions and cleanup
Given that the tests are failing, here's my proposed plan of action for finishing the merges:
|
@shankari I am not sure how to proceed with fixing my bug; the jest test passes on my local machine, and it passed the github action tests while it was just my PR #1092, but it fails in a strange unexpected way on this PR https://github.com/e-mission/e-mission-phone/actions/runs/7597279222/job/20691918950?pr=1085 It appears that the function to schedule the notifications works as expected, scheduling the 4 correct notifications. The issue is that after, I'm checking to see if the scheduledNotifs actually got scheduled by calling getScheduledNotifs. In here, the async behavior in getScheduledNotifs believes that the notifications are still in the process of being scheduled (which does not reproduce on my local machine), and then when it finishes scheduling, the notifications are not scheduled (however they are at this point on my local machine). Do you have any ideas for how I can fix this? Or perhaps test it in the github actions codecov environment so I at least have somewhere to go off of? At this point I'm not sure what the problem is and I don't know where to go from here.
|
@sebastianbarry have you pulled from I would:
There is no way to run GH actions locally. |
Also check if there is any difference between local environment and GH environment. For example, different version might cause the issue. It happened to me when I worked with GA so wanted to let you know! |
Was this "mismatched version on GA" on OpenPATH? This should not happen with OpenPATH because we have locked down our dependencies. When you run The reason for locking down the dependencies was exactly this - we wanted to have a consistent build and test process, so that a test failure was meaningful |
It happened when setting up prettier, but it is fixed now! |
The updates are in my pull request #1123 |
- Expanded types for several function parameters - Changed exported functions of `() => {}` format to `function () {}`
This better reflects the origin of this type: both BEMServerComm and BEMUserCache return data of this structure.
Test now compares the unpacked object map to original object.
Was running on `js/`, but not mocks; fixed formatting in mocks and tests!
@the-bay-kay I am merging this now to unblock @JGreenlee but it would be good if you could resolve the other comments as well when you have a chance. |
Before rewriting
www/js/diary/services.js
, I took some time to updatediaryHelper.ts
so that it no longer requires the legacy moment.js library.The plan, as with the other rewrites, is to convert the Angular services into typescript. These functions will be moved from
services.js
intotimelineHelper.ts
.