-
Notifications
You must be signed in to change notification settings - Fork 54
Write tests for crashes on RemixerFragment.showRemixer() being called too quickly. #64
Comments
I've looked into this. I discovered this while building the requested shake feature ( #112 ) - where if a shake is a high enough frequency, I can mitigate this on my end using a high-pass filter on the accelerometer data - but preferably we'd either debounce I've tried overriding the Any ideas? |
Github said email replies don't support markdown... soooo Thanks for taking the time to look into this Nick! The sad part is that there is a method on FragmentTransaction that does The other thing I can think of, which is a tad (very) hacky is to use a private Object syncLock = new Object();
private boolean isAddingFragment
public void showRemixer() {
synchronized(syncLock) {
if (!isAddingFragment) {
isAddingFragment = true;
show(.....);
}
}
}
public void onStart/onResume(...) {
synchronized(syncLock) {
isAddingFragment = false;
}
} Maybe even do it on onStop and call it "isFragmentAddedToStack"? dunno. Let me know if you try something like this. Thanks!! |
Good timing - right before I submitted my pull request / gave up on |
|
Seems fixed! This should be closed, no? I Think I tested it pretty thoroughly manually but would like to write actual tests (the reason being - I would also test sensor functionality). I assume a new issue should be opened for that. |
Let's repurpose this bug for that purpose, @nicksahler, that way we keep the context. |
This is quite easy to do on a slow device (or emulator).
First attach RemixerFragment to a button
Then tap on the button twice quickly. On a sufficiently slow device or emulator, you will get this crash:
Remixer should be hardened against this simple error.
The text was updated successfully, but these errors were encountered: