fossasia / open-event-organizer-android

Open Event Mobile App for Organizers and Entry Managers https://play.google.com/store/apps/details?id=com.eventyay.organizer
Apache License 2.0
1.79k stars 490 forks source link

Scanning attendee closes camera and fragment without checking in/out the attendee #1116

Closed mooocer closed 6 years ago

mooocer commented 6 years ago

Is it a ?

Bug Report

Actual Behaviour

When an attendee is scanned, the camera stops and attendee fragment closes without checking in or checking out the attendee.

Expected Behaviour

After scanning, an attendee should be checked in or out.

Steps to reproduce it

  1. Login with the test developer account
  2. Select event FOSSASIA Summit 2018
  3. Create a QR code online for the text: "d02f2999-8454-46d9-b9b6-de9c4d645192-52" (Attendee id 52)
  4. Go to attendees screen, and try scanning the generated QR code.
  5. The camera stops and fragment closes

LogCat for the issue on Xiaomi Redmi 4A

07-05 23:39:23.742 20408-20408/org.fossasia.eventyay W/System: ClassLoader referenced unknown path: /data/app/org.fossasia.eventyay-2/lib/arm64
07-05 23:39:23.784 20408-20408/org.fossasia.eventyay W/System.err: java.io.FileNotFoundException: /jacoco.exec: open failed: EROFS (Read-only file system)
        at libcore.io.IoBridge.open(IoBridge.java:452)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
        at org.jacoco.agent.rt.internal_8ff85ea.output.FileOutput.openFile(FileOutput.java:67)
        at org.jacoco.agent.rt.internal_8ff85ea.output.FileOutput.startup(FileOutput.java:49)
07-05 23:39:23.785 20408-20408/org.fossasia.eventyay W/System.err:     at org.jacoco.agent.rt.internal_8ff85ea.Agent.startup(Agent.java:122)
        at org.jacoco.agent.rt.internal_8ff85ea.Agent.getInstance(Agent.java:50)
        at org.jacoco.agent.rt.internal_8ff85ea.Offline.<clinit>(Offline.java:31)
        at org.fossasia.openevent.app.OrgaApplication.$jacocoInit(OrgaApplication.java)
        at org.fossasia.openevent.app.OrgaApplication.<clinit>(OrgaApplication.java)
        at java.lang.Class.newInstance(Native Method)
        at android.app.Instrumentation.newApplication(Instrumentation.java:997)
        at android.app.Instrumentation.newApplication(Instrumentation.java:982)
        at android.app.LoadedApk.makeApplication(LoadedApk.java:577)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4734)
        at android.app.ActivityThread.access$1700(ActivityThread.java:153)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1436)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:5523)
        at java.lang.reflect.Method.invoke(Native Method)
07-05 23:39:23.786 20408-20408/org.fossasia.eventyay W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
07-05 23:39:23.786 20408-20408/org.fossasia.eventyay W/System.err: Caused by: android.system.ErrnoException: open failed: EROFS (Read-only file system)
        at libcore.io.Posix.open(Native Method)
        at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
        at libcore.io.IoBridge.open(IoBridge.java:438)
        ... 21 more
07-05 23:39:24.045 20408-20408/org.fossasia.eventyay W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
07-05 23:39:24.203 20408-20408/org.fossasia.eventyay W/nAnnotationIntrospector: Unable to load JDK7 annotation types; will have to skip
07-05 23:39:24.536 20408-20449/org.fossasia.eventyay E/HAL: Dawei load: module=/system/lib64/hw/gralloc.msm8937.so
07-05 23:39:24.744 20408-20449/org.fossasia.eventyay E/HAL: Dawei load: module=/system/lib64/hw/gralloc.msm8937.so
07-05 23:39:25.096 20408-20408/org.fossasia.eventyay W/InputMethodManager: Ignoring onBind: cur seq=486, given seq=485
07-05 23:39:27.086 20408-20459/org.fossasia.eventyay W/System.err: WARNING: could not load Java7 Path class

LogCat for the issue on Samsung SM-G615F (API 24)

07-05 23:56:05.841 789-789/org.fossasia.eventyay E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.fossasia.eventyay, PID: 789
    java.lang.IllegalArgumentException: No injector was found for org.fossasia.openevent.app.core.attendee.checkin.AttendeeCheckInFragment
        at dagger.android.support.AndroidSupportInjection.findHasFragmentInjector(AndroidSupportInjection.java:92)
        at dagger.android.support.AndroidSupportInjection.inject(AndroidSupportInjection.java:57)
        at org.fossasia.openevent.app.common.di.AppInjector$2.onFragmentCreated(AppInjector.java:78)
        at android.support.v4.app.FragmentManagerImpl.dispatchOnFragmentCreated(FragmentManager.java:3474)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1380)
        at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1752)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1821)
        at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
        at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2595)
        at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2382)
        at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2337)
        at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2244)
        at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:702)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6776)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)

GIF of the issue

videotogif_2018 06 21_11 27 44

Android version and Phone Model

6.0.1 - Xiaomi Redmi 4A

Would you like to work on the issue?

Yes

iamareebjamal commented 6 years ago

It should display the bottom sheet view with attendee detail and control to checkin or checkout the attendee

mooocer commented 6 years ago

@iamareebjamal For checking small number of attendees, organizers can directly use the bottom sheet view by clicking the list items with search. Scanning, I think, is generally used for a queue of attendees. In that case if we repeatedly close the camera and make the organizer check-in/out the attendees manually, it would be cumbersome IMO. And that's why scan settings were added to decide what scanning does, just like in EventBrite.

iamareebjamal commented 6 years ago

Camera and Fragment closing is a bug, it never closed. The current flow was

Scan QR code -> Bottom Sheet Appears -> You check in or check out the attendee -> Scanning Resumes

mooocer commented 6 years ago

But shouldn't the middle 2 steps (Bottom Sheet Appears -> You check in or check out the attendee) be removed as it'll already be defined what scanning has to do? Or we can do as per scan settings, but still show the bottom sheet, so that organizer might reverse the step if it was not intended?

iamareebjamal commented 6 years ago

Yes, there should be 3rd setting, show checkin status which shows the bottom sheet

mooocer commented 6 years ago

This bug was giving different stack traces in both devices, and shows the error No injector was found for org.fossasia.openevent.app.core.attendee.checkin.AttendeeCheckInFragment for the device with API 24, and irrelevant warning for the other one.

This : https://github.com/mishuvs/open-event-orga-app/commit/e431fe8a7e33cd0fd85a0c60570cf3914d7ea9b8 is what I am trying to do, which is giving me the build errors:

  1. error: @Subcomponent.Builder is missing setters for required modules or subcomponents: [org.fossasia.openevent.app.common.di.module.BarcodeModule]
  2. error: org.fossasia.openevent.app.common.di.module.android.ActivityBuildersModule_ContributeScanQRActivity.ScanQRActivitySubcomponent (unscoped) may not reference scoped bindings:
    @Provides @Singleton @Named("barcodeEmitter") io.reactivex.subjects.PublishSubject<io.reactivex.Notification<com.google.android.gms.vision.barcode.Barcode>> org.fossasia.openevent.app.common.di.module.BarcodeModule.providesBarcodeEmitter()

First one is probably because of BarcodeModule not having parameter-less constructor:

public BarcodeModule(GraphicOverlay<BarcodeGraphic> graphicOverlay) {
        this.graphicOverlay = graphicOverlay;
    }

But I am not able to make it parameter-less.

@iamareebjamal @srv-twry @Masquerade0097 is there an alternate we can follow?

iamareebjamal commented 6 years ago

This may be due to the new AndroidInjector change I made

Check that out

mooocer commented 6 years ago

Yes, you are right. It was after adding AndroidInjector that it started crashing. I am not able to figure it out yet, but I think it should be a small fix. What do you suggest I should do now?

iamareebjamal commented 6 years ago

Rather than using AndroidInjector, use the old approach in this particular fragment