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

[BUG] Somehow in a state where every bg job is ignored #368

Open
raymeskhoury opened this issue May 12, 2024 · 1 comment
Open

[BUG] Somehow in a state where every bg job is ignored #368

raymeskhoury opened this issue May 12, 2024 · 1 comment

Comments

@raymeskhoury
Copy link

Your Environment

  • Plugin version: background_fetch: "^1.1.3"
  • Platform: iOS or Android
  • OS version: Android 14
  • Device manufacturer / model: Emulator
  • Flutter info (flutter info, flutter doctor):
  • Doctor summary (to see all details, run flutter doctor
    -v):
[√] Flutter (Channel stable, 3.19.6, on Microsoft
    Windows [Version 10.0.22631.3527], locale en-AU)
[√] Windows Version (Installed version of Windows is
    version 10 or higher)
[√] Android toolchain - develop for Android devices
    (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual
    Studio Community 2022 17.9.6)
[√] Android Studio (version 2023.3)
[√] VS Code (version 1.89.1)
[√] Connected device (4 available)
[√] Network resources

• No issues found!
  • Plugin config
BackgroundFetch.configure(
          BackgroundFetchConfig(
            minimumFetchInterval: 15,
            stopOnTerminate: false,
            startOnBoot: true,
            enableHeadless: true,
            requiresBatteryNotLow: false,
            requiresCharging: false,
            requiresStorageNotLow: false,
            requiresDeviceIdle: false,
            requiredNetworkType: NetworkType.NONE,
          ),
          _onBackgroundFetch)

To Reproduce
Not quite sure how I got into this state, but every BG sync event (whether real or simulated) is being ignored:

07-01 03:48:54.693  6537  6537 D TSBackgroundFetch: - Caught duplicate Job flutter_background_fetch: [IGNORED]
07-01 04:07:25.989  6537  6537 D TSBackgroundFetch: - Caught duplicate Job flutter_background_fetch: [IGNORED]
07-01 04:09:18.874  6537  6537 D TSBackgroundFetch: ☯️  onPause
07-01 04:09:18.896  6537  6537 D TSBackgroundFetch: ☯️  onStop
07-01 04:12:29.867  6537  6537 D TSBackgroundFetch: - Caught duplicate Job flutter_background_fetch: [IGNORED]

Additional context
I looked at the code for this and it is supposed to only treat jobs that are within 5 seconds of each other as duplicates but these aren't. I can't work out why by studying the code.

Also I noticed that all the job IDs are flutter_background_fetch. Is this expected? If this is only an issue with the emulator, etc. I don't really care just want to make sure there isn't a bug lurking.

@christocracy
Copy link
Member

Also I noticed that all the job IDs are flutter_background_fetch. Is this expected?

Yes.

You didn’t post your _onBackgroundFetch callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants