Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException in FrequencyChart.drawColumn #967

Closed
2 tasks done
iSoron opened this issue Jun 5, 2021 · 4 comments
Closed
2 tasks done

IllegalArgumentException in FrequencyChart.drawColumn #967

iSoron opened this issue Jun 5, 2021 · 4 comments
Labels
bug Something is not behaving as the developers expected confirmed The developers have been able to confirm that the issue is valid low-severity wont-fix The developers decided not to fix this issue
Milestone

Comments

@iSoron
Copy link
Owner

iSoron commented Jun 5, 2021

Pre-submission checklist

  • I am submitting a bug report, not a feature request.
  • I have searched for similar issues, but did not find any matches.

Description

From Google Play Console:

java.lang.IllegalArgumentException: 
  at org.isoron.uhabits.core.models.Timestamp.<init> (Timestamp.kt:127)
  at org.isoron.uhabits.core.models.Timestamp.<init> (Timestamp.kt:33)
  at org.isoron.uhabits.activities.common.views.FrequencyChart.drawColumn (FrequencyChart.kt:168)
  at org.isoron.uhabits.activities.common.views.FrequencyChart.onDraw (FrequencyChart.kt:134)
  at android.view.View.draw (View.java:22556)
  at android.view.View.draw (View.java:22429)
  at android.view.ViewGroup.drawChild (ViewGroup.java:4518)
  at android.view.ViewGroup.dispatchDraw (ViewGroup.java:4279)
  at android.view.View.draw (View.java:22427)
  at android.view.ViewGroup.drawChild (ViewGroup.java:4518)
  at android.view.ViewGroup.dispatchDraw (ViewGroup.java:4279)
  at android.view.View.draw (View.java:22559)
  at android.view.View.draw (View.java:22429)
  at android.view.ViewGroup.drawChild (ViewGroup.java:4518)
  at android.view.ViewGroup.dispatchDraw (ViewGroup.java:4279)
  at android.view.View.draw (View.java:22559)
  at org.isoron.uhabits.widgets.BaseWidget.getBitmapFromView (BaseWidget.kt:110)
  at org.isoron.uhabits.widgets.BaseWidget.buildRemoteViews (BaseWidget.kt:86)
  at org.isoron.uhabits.widgets.BaseWidget.getRemoteViews (BaseWidget.kt:120)
  at org.isoron.uhabits.widgets.BaseWidget.getLandscapeRemoteViews (BaseWidget.kt:48)
  at org.isoron.uhabits.widgets.StackRemoteViewsFactory.onDataSetChanged (StackRemoteViewsFactory.kt:145)
  at android.widget.RemoteViewsService$RemoteViewsFactoryAdapter.onDataSetChanged (RemoteViewsService.java:142)
  at com.android.internal.widget.IRemoteViewsFactory$Stub.onTransact (IRemoteViewsFactory.java:152)
  at android.os.Binder.execTransactInternal (Binder.java:1184)
  at android.os.Binder.execTransact (Binder.java:1143)

Steps to reproduce

  1. Create a Yes/No habit
  2. Open the habit statistics screen
  3. Scroll down to Frequency chart
  4. Scroll back all the way to January 1, 1970
  5. The app crashes

System information

  • Phone: Google Pixel 3a
  • Phone Operating System: Android 11
  • App version: 2.0.2
@iSoron iSoron added bug Something is not behaving as the developers expected cant-reproduce The developers cannot replicate the issue on their own devices high-severity labels Jun 5, 2021
@iSoron iSoron added this to the Loop 2.0.3 milestone Jun 5, 2021
@iSoron iSoron added confirmed The developers have been able to confirm that the issue is valid and removed cant-reproduce The developers cannot replicate the issue on their own devices labels Jun 6, 2021
@LordJon
Copy link

LordJon commented Jun 17, 2021

Probably already known but I can reproduce this bug in version 1.8.12 as well. It 'crashes' back to the main screen of the app.

@hiqua
Copy link
Collaborator

hiqua commented Jul 30, 2021

We don't support dates before 2000 do we? Given:
https://github.com/iSoron/uhabits/blob/dev/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/models/Timestamp.kt#L35-L39

So the solution is to prevent dates from going below 2000?

@iSoron
Copy link
Owner Author

iSoron commented Jul 31, 2021

@hiqua This has been partially fixed in branch hotfix/2.0.3

@iSoron iSoron added wont-fix The developers decided not to fix this issue low-severity and removed high-severity labels Jul 31, 2021
@iSoron
Copy link
Owner Author

iSoron commented Jul 31, 2021

Marking as wont-fix, since this will be automatically fixed when we migrate away from org.isoron.uhabits.core.models.Timestamp to the platform-independent org.isoron.platform.time.LocalDate. Charts that already use LocalDate are not affected by this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not behaving as the developers expected confirmed The developers have been able to confirm that the issue is valid low-severity wont-fix The developers decided not to fix this issue
Projects
None yet
Development

No branches or pull requests

3 participants