-
Notifications
You must be signed in to change notification settings - Fork 4
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
Refresh class roster plus refactor #2418
Open
scytacki
wants to merge
10
commits into
master
Choose a base branch
from
188181646-update-class-roster
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This uses applySnapshot to update the class users in place. This will make code using these users more efficient since they can just observer the user properties for changes.
Original the MST environment was avoided because I was planning to switch this store to just be MobX. However the group store needs to be synced with the data from the database, and it is easier to do that using MST than MobX.
This uses applySnapshot to sync the changes from the DB. This way the existing objects are updated instead of creating new ones. I also missed a change in stores when committing the last set of changes.
This will allow us to update the users later and have the group views automatically update without having to also update the group user objects. This also removes the option to skip unknown students. They are part of the group so we should show them even if we don't know who they are yet.
We use a timestamp for when the class information is retrieved from the portal. And compare this to the timestamp in the groupUser to figure out if this groupUser is older than the class info or newer than the class info.
The portal service object provides a place to store portal info like JWTs, and methods that use and update this info. This new object is used to refresh the class info if necessary after updating the group info from Firebase.
collaborative-learning Run #13915
Run Properties:
|
Project |
collaborative-learning
|
Branch Review |
188181646-update-class-roster
|
Run status |
Passed #13915
|
Run duration | 14m 09s |
Commit |
5eea6afa22: add test of removed users
|
Committer | Scott Cytacki |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
3
|
Skipped |
0
|
Passing |
112
|
View all changes introduced in this branch ↗︎ |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2418 +/- ##
==========================================
- Coverage 86.27% 86.26% -0.02%
==========================================
Files 741 742 +1
Lines 38220 38312 +92
Branches 9772 9792 +20
==========================================
+ Hits 32976 33050 +74
- Misses 4943 4962 +19
+ Partials 301 300 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a student is added to the class after CLUE has already launched, and then this new student runs CLUE and joins a group. The first student should see this new student.
To support this several changes were made:
Testing in demo mode:
It's possible to test some of this in demo mode. In demo a fake class is created for each tab that is running CLUE. This fake class is not shared with other tabs running in the same demo space and class. The fake class includes students with ids from 1 to 99. And it also includes the student that is in the URL. So if you launch CLUE with
fakeUser=student:900
, this student will be added to the class of this CLUE window but will not be added to the classes of any of the other CLUE windows. Additionally the fake class has a timestamp ofDate.now()
. These two "features" can be combined to simulate a new and removed user in the class.New User
student:1
that is not in group. If this student is in a group already leave the group by clicking on the group button on the top right of CLUE. You should be seeing the group chooser.student:900
. When this student:900 joins a group, the student:1 tab should see the group with a**
in it.This is because student:900 doesn't exist in the fake class in the student:1 tab. And timestamp of the class in the student:1 tab is older than the "connected" group user timestamp for this
student:900
.Removed User
student:900
. Now join a group.student:1
. If student:1 is an group, leave the group. You should not seestudent:900
or**
in any groups.This is because
student:900
is not in the fake class of thestudent:1
tab, and the group user connected timestamp forstudent:900
is older than the timestamp of the fake class used by thestudent:1
tab.Watch out when reloading tabs
If you reload the tabs used above, things will change. Each time the tab is reloaded the fakeClass timestamp is updated to the current time. And the group user connected timestamp for the current student is updated to the current time. So this will change the logic.
TODO: