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

[Calendar] - Android calendar is returning isPrimary with wrong value #28268

Open
joaogabrieldasilva opened this issue Apr 18, 2024 · 0 comments
Labels
Android Calendar needs review Issue is ready to be reviewed by a maintainer

Comments

@joaogabrieldasilva
Copy link

joaogabrieldasilva commented Apr 18, 2024

Minimal reproducible example

https://github.com/joaogabrieldasilva/expo-calendar-repro

Steps to reproduce

yarn/npm install

Expo Go

yarn start

Dev Build

npx expo run:android

What platform(s) does this occur on?

Android

Did you reproduce this issue in a development build?

Yes

Summary

I was trying to save an event in the user's primary calendar in Android when I noticed "isPrimary" was returning false in every calendar, so I decided to go to the Android docs and see what was the rule behind it and I found out that if the ACCOUNT_NAME and OWNER_ACCOUNT are the same, it means the calendar is the primary.

image

But even in the calendar that "ownerAccount" and "source.name" (which refers to ACCOUNT_NAME) were the same "isPrimary" was returning false.
When I tried to change this if condition from "1" (String) to 1 (Number) the correct "isPrimary" is returned

CalendarModule.kt
image

image

API 23 With IS_PRIMARY === "1"
image

API 23 With IS_PRIMARY === 1
image

So I want to know if this is really a bug or a made a mistake, if this is a bug I'll be happy to submit a PR

Environment

expo-env-info 1.2.0 environment info:
    System:
      OS: Linux 6.5 Ubuntu 23.10 23.10 (Mantic Minotaur)
      Shell: 5.9 - /usr/bin/zsh
    Binaries:
      Node: 20.12.2 - ~/.n/bin/node
      Yarn: 1.22.22 - ~/.n/bin/yarn
      npm: 10.5.0 - ~/.n/bin/npm
    SDKs:
      Android SDK:
        API Levels: 34
        Build Tools: 33.0.1, 34.0.0
        System Images: android-22 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom, android-34 | Google APIs ARM 64 v8a, android-34 | Google APIs Intel x86_64 Atom, android-34 | Google Play Intel x86_64 Atom
    npmPackages:
      expo: ~50.0.14 => 50.0.17 
      react: 18.2.0 => 18.2.0 
      react-native: 0.73.6 => 0.73.6 
    Expo Workflow: bare

Expo Doctor Diagnostics

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✖ Check native tooling versions
✖ Check Expo config (app.json/ app.config.js) schema
Unexpected error while running 'Check Expo config (app.json/ app.config.js) schema' check:
FetchError: request to https://exp.host/--/api/v2/project/configuration/schema/50.0.0 failed, reason: getaddrinfo EAI_AGAIN exp.host
✔ Check npm/ yarn versions
✔ Check for issues with metro config
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that native modules use compatible support package versions for installed Expo SDK
✔ Check that packages match versions required by installed Expo SDK

Detailed check results:

Cocoapods version check failed. Cocoapods may not be installed or there may be an issue with your Cocoapods installation. Installing version 1.15.2 or higher is recommended.

One or more checks failed, indicating possible issues with the project.
@joaogabrieldasilva joaogabrieldasilva added the needs validation Issue needs to be validated label Apr 18, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Calendar needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants