ekx / GitLabAndroid

Unofficial GitLab client for Android
193 stars 62 forks source link

crash when displaying commit diff #21

Closed wfleurant closed 8 years ago

wfleurant commented 10 years ago

Recent update now exhibits this crash.

screenshot_2014-10-30-18-55-35

JosephTurner commented 10 years ago

Does that commit have a commit message? The message String seems to be null

wfleurant commented 10 years ago

Yes Joe, all commits have messages. Hmm. May be I should investigate server side? However, the last stable release to Google Play did not exhibit this issue when viewing commit diff/msg.

JosephTurner commented 10 years ago

Are you commit messages one liners, with just the title? If so, this is then making message null, and this should be able to be fixed by just returning the empty DiffLine ArrayList if message is null.

wfleurant commented 10 years ago

The pcap shows the last HTTP returned to GitLabAndroid was JSON containing id, sort_id, title... Yes Joe, the member 'title' is typically a one liner. example "fixes #123 ..." That's when it crashes.

JosephTurner commented 10 years ago

Does that fix it?

edit: Or maybe I should make it show title instead of nothing?

wfleurant commented 10 years ago

I'll build tomorrow and see what's what. I don't mind if title is missing because it was last selected... although it may be truncated, eh?

JosephTurner commented 10 years ago

Turns out the issue is message was only introduced in 7.2.

https://github.com/gitlabhq/gitlabhq/commit/e59674f9545d36da13c306e223b2cb84e9fcaa48

I'll make a commit where it shows title instead

wfleurant commented 10 years ago

Ah, OK.. I ran in to newbie build issues, but I'll retry w/ incoming commits. Thanks in advance Joe.

wfleurant commented 10 years ago

I've been bogged down to retry this.. Was caught up with Android Studio and wrong gradle versions last time. I'll give it a try again Joe. Thanks for bearing with my delays.

wfleurant commented 10 years ago

Joe, I've got this far.. Tried using docker with both wasabeef/android and ksoichiro/android at got to here. We aught to escalate this, though.. The number of comments regarding this crash on Google Play seem to be increasing.

bash-4.1# docker run -i -t wasabeef/android /bin/bash
bash-4.1# android update sdk --no-ui --all --filter platform-tools,extra-android-support,extra-android-m2repository,extra-google-m2repository,build-tools-19.0.1,android-19,build-tools-20.0.0
bash-4.1# git clone https://github.com/JosephTurner/GitLabAndroid.git -b origin/issue/21
bash-4.1# ./gradlew assembleRelease

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.android.support:support-v4:20.0.0.
     Required by:
         gl_jt:app:unspecified
   > Could not find com.android.support:support-annotations:20.0.0.
     Required by:
         gl_jt:app:unspecified > com.melnykov:floatingactionbutton:1.0.4

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
JosephTurner commented 9 years ago

Go to SDK manager and install the Android Support Repository.

wfleurant commented 9 years ago

Joe, I bailed using docker and --no-ui building... I couldn't update the m2/support repos! GitLabAndroid is running inside the emulator now. I chose the recommended gradle settings this time in Android Studio.

Testing in Emulator

Nearly every commit message works without crash. Thank you Joe! :beer:

I am however able to reproduce a similar (but specific) crash. When attempting to show a commit message (of a merged tag) that was signed with a GPG key then the app will crash. Unsigned merge commits are looking great!

What do you think?

JosephTurner commented 9 years ago

Have you got a stack trace?

wfleurant commented 9 years ago

Same results on Emulator x86_64 and HTC M8. *edit nov-21 | Should I test very large and unsigned commits or small signed commits? I'm suspect the signatures are a red herring. Again, thanks.

E/art﹕ Throwing OutOfMemoryError "Failed to allocate a 28 byte allocation with 0 free bytes and 3GB until OOM" (recursive case)
E/art﹕ "main" prio=5 tid=1 Runnable
E/art﹕ | group="main" sCount=0 dsCount=0 obj=0x73fa2970 self=0xf4606800
E/art﹕ | sysTid=2345 nice=0 cgrp=default sched=0/0 handle=0xf77c9160
E/art﹕ | state=R schedstat=( 0 0 0 ) utm=228 stm=10 core=0 HZ=100
E/art﹕ | stack=0xff582000-0xff584000 stackSize=8MB
E/art﹕ | held mutexes= "mutator lock"(shared held)
I/art﹕ Alloc concurrent mark sweep GC freed 0(0B) AllocSpace objects, 0(0B) LOS objects, 0% free, 32MB/32MB, paused 0 total 60ms
W/art﹕ Suspending all threads took: 30ms
E/System﹕ Uncaught exception thrown by finalizer
E/System﹕ java.lang.OutOfMemoryError: Failed to allocate a 24 byte allocation with 0 free bytes and 3GB until OOM
            at com.android.internal.os.BinderInternal$GcWatcher.finalize(BinderInternal.java:51)
            at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:190)
            at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:173)
            at java.lang.Thread.run(Thread.java:818)
I/Process﹕ Sending signal. PID: 2345 SIG: 9
D/OpenGLRenderer﹕ Render dirty regions requested: true
D/AndroidRuntime﹕ Shutting down VM
E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.bd.gitlab, PID: 2380
MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.widget.Filter com.bd.gitlab.adapter.DrawerAdapter.getFilter()' on a null object reference
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
            at android.app.ActivityThread.access$800(ActivityThread.java:144)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.widget.Filter com.bd.gitlab.adapter.DrawerAdapter.getFilter()' on a null object reference
            at com.bd.gitlab.MainActivity$2.onTextChanged(MainActivity.java:106)
            at android.widget.TextView.sendOnTextChanged(TextView.java:7663)
            at android.widget.TextView.setText(TextView.java:4050)
            at android.widget.TextView.setText(TextView.java:3905)
            at android.widget.EditText.setText(EditText.java:85)
            at android.widget.TextView.setText(TextView.java:3880)
            at android.widget.TextView.onRestoreInstanceState(TextView.java:3780)
            at android.view.View.dispatchRestoreInstanceState(View.java:13621)
            at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2893)
            at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2893)
            at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2893)
            at android.view.View.restoreHierarchyState(View.java:13599)
            at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1982)
            at android.app.Activity.onRestoreInstanceState(Activity.java:1022)
            at android.app.Activity.performRestoreInstanceState(Activity.java:977)
            at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1161)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2271)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
            at android.app.ActivityThread.access$800(ActivityThread.java:144)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
I/Process﹕ Sending signal. PID: 2380 SIG: 9
wfleurant commented 9 years ago

@JosephTurner Can you PR? The crash is due to huge diff.

wfleurant commented 9 years ago

@JosephTurner I made a PR ..b3f9f89 -- It's been stable, thanks again Joe. :beers:

wfleurant commented 9 years ago

PR not yet accepted... Is there something missing? @JosephTurner