RoyalSloth / SlothTracker

Cross Platform Time Tracking Software
https://www.royalsloth.eu
0 stars 0 forks source link

Application crash in Overview window #3

Closed uwebenner closed 4 years ago

uwebenner commented 4 years ago

Environment

Operating System: Mac OS X 10.15.3 (Catalina)
SlothTracker version: 1.4.3

Steps to reproduce

I could not run the dmg file, so I loaded the jar file.

Expected behavior

(I've read the docs now) The last step should have closed the window or done nothing.

Actual behavior

The whole application crashed. Luckily it was printing stuff in the terminal window:

> java -jar SlothTracker-1.4.3.jar
21:27:03:103 DEBUG [JavaFX Application Thread] com.royalsloth.timetracker.utils.ConfigurationStoring.79 - We are on mac system: /Users/user
21:27:03:803 DEBUG [Thread-4] com.royalsloth.timetracker.dialogs.preferences.TrackerConfiguration.56 - Tracker configuration does not exist, use default values
21:27:04:204 INFO [Thread-4] org.flywaydb.core.internal.logging.slf4j.Slf4jLog.49 - Flyway Community Edition 6.0.0 by Boxfuse
21:27:04:204 INFO [Thread-4] org.flywaydb.core.internal.logging.slf4j.Slf4jLog.49 - Database: jdbc:sqlite:/Users/user/Library/Preferences/RoyalSloth/Slothtracker/timetrackerDB.db (SQLite 3.25)
appConnectionsSetup(ms) = 1029.300877
21:27:05:105 DEBUG [JavaFX Application Thread] com.royalsloth.timetracker.dialogs.overview.perDay.DayTaskOverviewTreeTable.699 - Tree table update triggered
loadingEntireApp(ms) = 2777.751144
21:27:05:805 DEBUG [JavaFX Application Thread] com.royalsloth.timetracker.dialogs.licensing.TrackerLicense.199 - No license key exist
21:27:07:607 DEBUG [JavaFX Application Thread] com.royalsloth.timetracker.dialogs.overview.perDay.DayTaskOverviewTreeTable.699 - Tree table update triggered
2020-04-03 21:27:23.348 java[4789:463151] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff302608ab __exceptionPreprocess + 250
    1   libobjc.A.dylib                     0x00007fff6651a805 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff3030f8ae _CFThrowFormattedException + 202
    3   CoreFoundation                      0x00007fff301813ee -[NSTaggedPointerString hash] + 0
    4   AppKit                              0x00007fff2d6f8dc2 -[NSView performKeyEquivalent:] + 157
    5   AppKit                              0x00007fff2dc41cde -[NSWindow _commonPerformKeyEquivalent:conditionally:] + 73
    6   libglass.dylib                      0x000000010b1329b0 -[GlassWindow_Normal performKeyEquivalent:] + 64
    7   AppKit                              0x00007fff2db2d8e4 routeKeyEquivalent + 162
    8   AppKit                              0x00007fff2d54d64c -[NSApplication(NSEvent) sendEvent:] + 1072
    9   libglass.dylib                      0x000000010b122005 +[GlassApplication enterNestedEventLoopWithEnv:] + 213
    10  libglass.dylib                      0x000000010b122a7a Java_com_sun_glass_ui_mac_MacApplication__1enterNestedEventLoopImpl + 74
    11  ???                                 0x00000001142c5c90 0x0 + 4633418896
)
libc++abi.dylib: terminating with uncaught exception of type NSException
zsh: abort      java -jar SlothTracker-1.4.3.jar

Screenshots

No screenshots needed.

RoyalSloth commented 4 years ago

Thanks for the report.

I am not sure if that is the same bug (as I never saw that stacktrace before), but following your description I managed to reproduce the Enter key triggering a nullpointer exception in exactly that table).

If you want to execute action on a table via keyboard, press 'M' key (and I just realized that is not mentioned in the documentation). Every table that supports extra actions will popup a context menu (same as right mouse click)

uwebenner commented 4 years ago

Wow. That was quick! :D

It seams that all changing events crash the application (add/edit/delete task). The Ok and Delete buttons work fine though.

I've written my own terminal based time tracker and I'm here for inspiration and maybe to steal a feature or two, and I must say I really like your app. Keep it up! 👍

RoyalSloth commented 4 years ago

Can you be a bit more specific, which add/edit/delete task. Does that happen in an overview dialog (when editing tables) or some place else?

uwebenner commented 4 years ago

In the "Add Task" and "Edit Task" Windows. Which seam to be the same windows, since Add Task has the Delete button as well. :)

Add Task
RoyalSloth commented 4 years ago

So I did upload the patch (v1.4.4) that fixes the previously mentioned nullpointer exception which you may try, but I am not sure if it fixes this MacOs specific problem.

uwebenner commented 4 years ago

I've testet the new version and it is still the same problem.

RoyalSloth commented 4 years ago

I was able to reproduce this issue and this seems like a bug in the JavaFx framework. It only happens if ENTER+META or ENTER+CTRL are clicked. If I change the dialog confirm action to ENTER+ALT (Option key on Mac) this exception is not triggered and the app does not crash.

I'll try to report the bug to the framework maintainers. In the meantime I can only provide a patch for MacOs that will trigger dialog apply event via ENTER+ALT/Option key instead of ENTER+CTRL.

RoyalSloth commented 4 years ago

I have reported a bug in the toolkit and provided a temporary workaround (already uploaded as v1.4.4). The dialog confirm actions in MacOs could now be triggered with the ENTER+ALT/Option key (which shouldn't crash the application).

It's a bit inconvenient, but that is the only thing I can do right now.

uwebenner commented 4 years ago

Thank you. I have testet it and it does not work. I totally forgot that the Alt/Option (and Alt + Shift) Key is used to modify the keypress like the shift key does. E.g. alt + t gives the character †. Might be the reason Alt + Enter didn't work.

RoyalSloth commented 4 years ago

Well it didn't work because I forgot to upload a jar (I have only uploaded .dmg). Please try again.

Yes ALT tends to do that, but only if you press a character. ALT+Enter works as expected, at least on my machine.

uwebenner commented 4 years ago

Ahh, now it's working.

RoyalSloth commented 4 years ago

Great to hear, closing.