Skip to content

Incrementing to version 1.0.2#40

Merged
SuperMeerkat345 merged 2 commits intomasterfrom
features-master
Mar 29, 2026
Merged

Incrementing to version 1.0.2#40
SuperMeerkat345 merged 2 commits intomasterfrom
features-master

Conversation

@SuperMeerkat345
Copy link
Copy Markdown
Collaborator

@SuperMeerkat345 SuperMeerkat345 commented Mar 29, 2026

Fixed the error counting logic which was broken during a previous merge.

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced network data synchronization with improved error handling and retry limits for more reliable offline-to-online transitions.
  • Chores

    • Version updated to 1.0.2.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 29, 2026

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

The PR updates the app version to 1.0.2 and refactors the network synchronization logic to include a bounded error limit. The retry mechanism in NetworkMonitor transitions from infinite retries until success to bounded retries with an explicit maxErrors parameter, affecting multiple components.

Changes

Cohort / File(s) Summary
Version Update
app/build.gradle.kts
Bumped versionName from "1.0.1" to "1.0.2".
Network Sync Interface
app/src/main/java/com/team695/scoutifyapp/data/api/service/NetworkService.kt
Updated networkSync() signature to accept maxErrors: Int parameter.
Network Monitor Implementation
app/src/main/java/com/team695/scoutifyapp/data/api/NetworkMonitor.kt
Refactored retry logic from unbounded (loop until success) to bounded with error counter; added maxErrors parameter to networkSync() and retryPushUntilSuccess(), introduced error tracking, network connectivity checks, and early termination when error limit is reached; updated final logging to distinguish success vs. max error limit exceeded.
Network Sync Callers
app/src/main/java/com/team695/scoutifyapp/MainActivity.kt, app/src/main/java/com/team695/scoutifyapp/ui/screens/login/LoginScreen.kt
Updated networkMonitor.networkSync() calls to pass maxErrors = 10 parameter.
Miscellaneous
app/src/main/java/com/team695/scoutifyapp/ui/screens/home/MatchSchedule.kt
Added android.util.Log import.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client<br/>(MainActivity/<br/>LoginScreen)
    participant Monitor as NetworkMonitor
    participant ConnCheck as Network<br/>Connectivity
    participant GameRepo as GameDetail<br/>Repository
    participant OtherRepos as Other<br/>Repositories

    Client->>Monitor: networkSync(maxErrors=10)
    Monitor->>Monitor: errors = 0
    
    rect rgba(100, 150, 200, 0.5)
    Note over Monitor: Fetch Phase
    loop until GameDetailRepository success or errors >= maxErrors
        Monitor->>ConnCheck: isConnected.first { it }
        ConnCheck-->>Monitor: wait for connection
        Monitor->>GameRepo: fetch()
        alt Success
            GameRepo-->>Monitor: data
        else Failure
            GameRepo-->>Monitor: error
            Monitor->>Monitor: errors++
            Monitor->>Monitor: log error & delay
        end
    end
    end

    rect rgba(150, 100, 200, 0.5)
    Note over Monitor: Sync Phase
    loop for each remaining repository
        Monitor->>ConnCheck: isConnected.first { it }
        ConnCheck-->>Monitor: connected
        Monitor->>OtherRepos: fetch()/push()
        alt Success
            OtherRepos-->>Monitor: ok
            Monitor->>Monitor: remove from pending
        else Failure
            OtherRepos-->>Monitor: error
            Monitor->>Monitor: errors++
            alt if errors < maxErrors
                Monitor->>Monitor: log & delay
            else
                Monitor->>Monitor: stop retrying
            end
        end
    end
    end

    alt pending list empty
        Monitor-->>Client: success
    else errors >= maxErrors
        Monitor-->>Client: max errors exceeded
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • PR #39: Modifies NetworkMonitor.kt and network synchronization flow; may interact with this PR's bounded retry logic and error handling changes.

Suggested labels

enhancement

Poem

🐰 A boundless sync that once ran wild,
Now tamed with limits, defined and styled!
Ten errors max before we yield,
The network quest is now controlled and sealed.
From 1.0.1 to 1.0.2, a leap so bright! 🚀

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'Incrementing to version 1.0.2' describes only the version bump in build.gradle.kts, but the primary changes involve fixing error counting logic in the NetworkMonitor and updating method signatures across multiple files. Update the title to reflect the main objective: 'Fix error counting logic in network synchronization' or 'Fix network sync error counting and bump to version 1.0.2' to better represent the substantial changes beyond version numbering.
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch features-master

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot added the enhancement New feature or request label Mar 29, 2026
@SuperMeerkat345 SuperMeerkat345 merged commit f1161c2 into master Mar 29, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant