Skip to content

STUDYU-95: feat(app): complete Fitbit tasks offline - #956

Open
johannesvedder wants to merge 3 commits into
feat/studyu-906-deferred-fitbit-syncfrom
feat/studyu-906-offline-fitbit-participation
Open

johannesvedder wants to merge 3 commits into
feat/studyu-906-deferred-fitbit-syncfrom
feat/studyu-906-offline-fitbit-participation

Conversation

@johannesvedder

@johannesvedder johannesvedder commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Description

Related Jira issue: STUDYU-95

Stack 3 of 3 · Previous: #955

The deferred Fitbit engine from #955 must be connected to the visible participant flow. Participants also need durable Fitbit authorization before leaving the online kickoff so Fitbit tasks can be completed without connectivity.

This PR:

  • requires durable Fitbit authorization during kickoff only for studies containing Fitbit questions;
  • keeps participants in setup with retry when authorization is cancelled or storage fails;
  • completes Fitbit questionnaire tasks locally while connectivity is degraded;
  • queues the original Fitbit acquisition window instead of invoking immediate synchronization;
  • keeps the normal online Fitbit path unchanged;
  • resolves queued Fitbit data after reconnecting, including after the study has ended;
  • handles calendar-day Fitbit acquisition windows without creating placeholder answers.

This completes the three-PR advanced offline participation stack built on #936.

Testing Steps

  1. Start a Fitbit study online and verify kickoff cannot complete until authorization is durably stored.
  2. Disconnect, complete ordinary, media, and Fitbit tasks, then reload while still offline.
  3. Reconnect after the study ends and verify pending media, Fitbit data, and ordinary progress synchronize once.
  4. Verify non-Fitbit studies and online Fitbit completion retain their existing behavior.
  5. Automated verification completed:
    • 61 integrated recovery, cleanup, cache, offline-task, and Fitbit tests;
    • scripts/pre-commit-check;
    • git diff --check.

Manual Fitbit OAuth, token refresh/revocation, rate limits, and real multi-day sleep responses remain device/API verification items.

PR Checklist

  • I tested the changes and affected user flows.
  • I reviewed the full diff and checked for unintended changes.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 69f5e201-7c82-4599-bd42-bbb9077ea26e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

955 - PR Code Verified

Compliant requirements:

  • Connect deferred Fitbit completion to the participant questionnaire flow.
  • Queue Fitbit completion while connectivity is degraded.
  • Preserve the normal online Fitbit synchronization path.
  • Require Fitbit authorization during kickoff for Fitbit studies.

Requires further human verification:

  • Verify historical acquisition after the study end date with real Fitbit data.
  • Verify pending media ordering, retry behavior, and destructive-operation barriers across the complete stacked implementation.
  • Verify OAuth cancellation, token refresh, revocation, rate limits, and multi-day sleep responses on real devices and APIs.

936 - PR Code Verified

Compliant requirements:

  • Preserve the existing offline task-completion integration by delegating deferred Fitbit completion through handleTaskCompletion.

Requires further human verification:

  • Verify the complete stacked cache-recovery, cleanup, authentication, and destructive-operation behavior from the earlier PRs.
  • Verify offline completion and synchronization across ordinary, media, and Fitbit tasks in the participant UI.
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🏅 Score: 91
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 71c468b):

(expires Sat, 05 Sep 2026 11:01:32 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2149dad49ed83535217e50d5c18c0c8c90da629b

@johannesvedder johannesvedder changed the title STUDYU-906: feat(app): complete Fitbit tasks offline STUDYU-95: feat(app): complete Fitbit tasks offline Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant