Virtual pump: TBR and extended bolus rates on the pump tab are multiplied by the concentration
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- kotlin
- Domain
- mobile-dev
Research direction
Read VirtualPumpViewModel.kt around lines 113–128 and trace how PumpRate and ch.basalTbrString handle concentration, checking PumpSyncImplementation.kt around line 391. Also inspect VirtualPumpPlugin.kt around lines 224–225 and the related issue #5486. Verify both reported behaviors independently; done when the displayed TBR and extended bolus rates are correct and the virtual pump basal rate stays consistent during concentration changes.
Written by the indexing model from the issue text.
Description
Found via AI-assisted code review (Claude) of upstream code, while checking the logs of my personal build of dev (current
devplus my own local changes). Each point below was checked against nightscout/dev 11681e46fe by reading the code. It was not reproduced on a pump or a phone, and no test was written or run for it. Please verify independently before acting on it.
VirtualPumpViewModel.kt:113-117(TBR) and:125-128(extended bolus) wrap the database rate as
PumpRate(pump units) and pass it toch.basalTbrString. That rate is already in IU, because PumpSync
stores it converted (PumpSyncImplementation.kt:391). So the concentration is applied a second time. At
U200 a 1.00 U/h TBR shows as "2.00 U/h (1.00 cU/h)" instead of "1.00 U/h (0.50 cU/h)". Percent TBRs are
fine.- Also:
VirtualPumpPlugin.baseBasalRate(:224-225) follows the requested PS through
expectedPumpState(), before the EPS exists. Between the PS insert and the mirror refresh,
current_basalis half (U100 to U200) or double (U200 to U100). This is on the Virtual pump only, and no
insulin moves.
Related: #5486 (same insulin concentration change).
- Dominant language
- Kotlin
- Stars
- 1.2k
- Forks
- 7.4k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 86
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nightscout/AndroidAPS
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nightscout/AndroidAPS#5481 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nightscout/AndroidAPS#5478 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
nightscout/AndroidAPS#5475 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
enhancement for_discussion minor
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
nightscout/AndroidAPS#5422 ·
Maintainers usually reply within 1 day
-
enhancement for_discussion
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
nightscout/AndroidAPS#5057 · 2 comments ·
Maintainers usually reply within 1 day
All issues in nightscout/AndroidAPS
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 2 days
-
unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
thunderbird/thunderbird-android#11893 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Droid-Deck/DroidDeck#2198 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
world-federation-of-advertisers/cross-media-measurement#4846 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day