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

Automatically sync with server when Match Exactly enabled #3960

Merged
merged 27 commits into from
Jul 14, 2020

Conversation

seadowg
Copy link
Member

@seadowg seadowg commented Jul 7, 2020

Closes #3939

What has been done to verify that this works as intended?

Lots of new tests and played with automatic sync manually on the emulator.

Why is this the best possible solution? Were any other approaches considered?

The biggest decision here was whether to just use WorkManager as is or include it in our async.Scheduler abstraction. I ended up going with the latter as it means we can write tests for the automatic sync we wouldn't be able to write otherwise (like those found in MatchExactlyTest). This does mean we end up with a weighty abstraction in TaskSpec. I'm planning the other background jobs to using this as part of #3940.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

As with previous Match Exactly PRs we're going to skip QA on this and wait until the feature is complete.

Before submitting this PR, please make sure you have:

  • run ./gradlew checkAll and confirmed all checks still pass OR confirm CircleCI build passes and run ./gradlew connectedDebugAndroidTest locally.
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@seadowg seadowg force-pushed the auto-match-exactly branch 4 times, most recently from 5fde62f to 14ec8de Compare July 10, 2020 09:44

class AudioPlayerViewModel extends ViewModel implements MediaPlayer.OnCompletionListener {

private final MediaPlayerFactory mediaPlayerFactory;
private final Supplier<MediaPlayer> mediaPlayerFactory;
Copy link
Member Author

Choose a reason for hiding this comment

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

I ran into a problem with the audio stuff due to it instantiating a Scheduler so had to do a slight rework. I like the idea of using Supplier instead of an explicit ...Factory or ...Provider type now the new desugaring gives us access to it. We might still need a concrete class for Dagger but everything else should be able to use Supplier.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. Add a note in the "state of the union"?

@@ -13,6 +14,10 @@ private MultiClickGuard() {

// Debounce multiple clicks within the same screen
public static boolean allowClick(String className) {
if (test) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I ran into problems with this blocking clicks in tests locally

@seadowg seadowg marked this pull request as ready for review July 10, 2020 10:52
@seadowg seadowg force-pushed the auto-match-exactly branch from 14ec8de to 20b3a11 Compare July 13, 2020 15:08
Copy link
Member

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

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

Couple small things!

collect_app/build.gradle Show resolved Hide resolved
collect_app/build.gradle Show resolved Hide resolved

class AudioPlayerViewModel extends ViewModel implements MediaPlayer.OnCompletionListener {

private final MediaPlayerFactory mediaPlayerFactory;
private final Supplier<MediaPlayer> mediaPlayerFactory;
Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. Add a note in the "state of the union"?

@lognaturel
Copy link
Member

@seadowg can you please keep a running list of sources of risk so that QA can do a regression check once the feature is complete? Here I see:

  • audio in questions
  • pushing forms from adb and having them show up in the right places

@seadowg
Copy link
Member Author

seadowg commented Jul 14, 2020

@lognaturel that's a good shout. I'll keep a list in my local notes and then post when we get to doing QA on master

@lognaturel lognaturel merged commit 3427d65 into getodk:master Jul 14, 2020
@seadowg seadowg deleted the auto-match-exactly branch July 15, 2020 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add periodic Match Exactly updates
2 participants