Simple-Calendar icon indicating copy to clipboard operation
Simple-Calendar copied to clipboard

bugfix multi week event not showing in next week

Open DoozyDoz opened this issue 3 years ago • 5 comments

Description

  • As reported in issue #1799 , events that span more than one week were not visible in the last week.

DoozyDoz avatar Sep 02 '22 01:09 DoozyDoz

could you give exact steps for reproducing what does this fix? With specific dates to be set.

tibbi avatar Sep 11 '22 16:09 tibbi

could you give exact steps for reproducing what does this fix? With specific dates to be set.

Hello @tibbi, Thanks for taking time to review, below are the steps to reproduce the bug and the last is the screen shot of the fix

1. First uncheck this option in settings -> weekly view

2. Switch to week view

3. Create an event that spans two weeks eg.

4. [BUG] The event will not appear in the second week only the first week.

5. [FIX] The event appears as expected.

DoozyDoz avatar Sep 11 '22 18:09 DoozyDoz

Yep, the option Show events spanning across midnight at the top bar seems to have also other buggy behavior - e.g. https://github.com/SimpleMobileTools/Simple-Calendar/issues/1767 .

dumblob avatar Sep 11 '22 20:09 dumblob

Yep, the option Show events spanning across midnight at the top bar seems to have also other buggy behavior - e.g. #1767 .

@dumblob , PR 1837 should fix this, kindly test on your side too

DoozyDoz avatar Sep 11 '22 21:09 DoozyDoz

@DoozyDoz wow, that fix looks good!

By any chance, do you or @tibbi have any CI regularly creating apks for PRs? I do not have Android studio available now so I would need a binary to test it. So far I noticed @Naveen3Singh is preparing such binaries only manually.

dumblob avatar Sep 12 '22 07:09 dumblob

@tibbi did you forget this repo?

DoozyDoz avatar Oct 14 '22 20:10 DoozyDoz

no, Im just always hesitant with such PRs :) They always fix one thing but break something else.

tibbi avatar Oct 14 '22 20:10 tibbi

I have tested it quickly and it seems to work for me (but of course, there might be some edge cases which my regular calendars do not contain/exhibit).

Could you @tibbi also test it? Thanks!

dumblob avatar Oct 17 '22 10:10 dumblob

Im getting a null pointer exception at line 574: y = currentEventWeeklyView!!.range.lower * minuteHeight

tibbi avatar Oct 25 '22 09:10 tibbi

@DoozyDoz working on the crash?

tibbi avatar Nov 12 '22 09:11 tibbi

@tibbi oh i had missed this, let me fix it

DoozyDoz avatar Nov 12 '22 12:11 DoozyDoz

Hello @tibbi I have failed to reproduce the null pointer error, may I ask in which situation you got it?

DoozyDoz avatar Nov 12 '22 13:11 DoozyDoz

I have an event from October 21, 23:00 to October 23, 23:00 and when I swipe to it, it crashes when I swipe to the week even starting with October 31. Try creating random long events, my weeks start on monday.

tibbi avatar Nov 12 '22 15:11 tibbi

I have tried creating different long events (some spanning 2 weeks, others 3 weeks) I only get the error if i uncheck "Start week on Sunday" in settings Let me investigate and push a fix

DoozyDoz avatar Nov 13 '22 07:11 DoozyDoz

Quick look that might help:

It crashes probably because the view was stored with a different key in the first loop, see https://github.com/SimpleMobileTools/Simple-Calendar/blob/af84b9a5af8288d825a569b8db24d248bcd67cc9/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt#L451-L461

And startDayCode at line 574 now has a different day code after the proposed changes than the one on line 451. Both should be same.

naveensingh avatar Nov 13 '22 08:11 naveensingh