Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Android: placing a server-driven Dynamic Widget fetches from the server twice

Open
#345 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
android, kotlin, react-native

Research direction

Start in packages/android-client/android/src/main/java/voltra/dynamicwidget/serverupdate/DynamicWidgetServerUpdateScheduler.kt, reading schedule(), enqueuePeriodic() and requestImmediateUpdate(), and check whether the periodic request is enqueued without an initial delay. Confirm the double fetch by counting requests with adb logcat -s VoltraDynamicServerSched. Done means one request per placement, with VoltraWidgetUpdateScheduler checked for the same pattern.

Written by the indexing model from the issue text.

Description

bug platform:Android Widget

Follow-up to #293, where the reporter noticed it.

What happens

Placing a server-driven Dynamic Widget (a widget with both entry and serverUpdate) makes two identical HTTP requests to the server within the same second.

Reported on 2.3.0 with a physical device and a PHP endpoint logging every hit: two requests with the same timestamp each time the widget is added.

Likely cause (from reading the code, not yet confirmed on a device)

DynamicWidgetServerUpdateScheduler.schedule() does two things for a scope that has just been scheduled:

  1. enqueuePeriodic(...) enqueues a PeriodicWorkRequest with no initial delay. WorkManager runs the first execution of a periodic request as soon as its constraints are met, not after one interval.
  2. requestImmediateUpdate(...) (when runImmediately is true, which recompute() passes for a scope with no previous schedule) enqueues a separate expedited one-time request under the _once work name.

Those are two different unique work names, so nothing collapses them, and both run DynamicWidgetServerUpdateRunner straight away.

Relevant code: packages/android-client/android/src/main/java/voltra/dynamicwidget/serverupdate/DynamicWidgetServerUpdateScheduler.kt (schedule, enqueuePeriodic, enqueueOneTime).

Expected

One fetch when a widget is placed.

Possible fix

Give the periodic request an initial delay of one interval (setInitialDelay) whenever the immediate one-time request is also enqueued, so the one-time request is the placement fetch and the periodic one takes over afterwards. The one-time request is the better one to keep because it is expedited.

VoltraWidgetUpdateScheduler (payload-driven widgets) also uses enqueueUniquePeriodicWork plus a requestImmediateUpdate; worth checking whether it has the same shape.

How to verify

Pin a server-driven Dynamic Widget on a device or emulator and count requests on the server (or adb logcat -s VoltraDynamicServerSched VoltraClientGlanceWidget). Expect one request per placement after the fix.

Dominant language
TypeScript
Stars
844
Forks
45
Avg merge
2d 14h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from callstackincubator/voltra

All issues in callstackincubator/voltra

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.