Skip to content

Fix type inference for MutableStore.get() and fresh() extensions (#555) - #766

Open
binayshaw7777 wants to merge 1 commit into
MobileNativeFoundation:mainfrom
binayshaw7777:binay/fix-mutablestore-get-fresh
Open

binayshaw7777 wants to merge 1 commit into
MobileNativeFoundation:mainfrom
binayshaw7777:binay/fix-mutablestore-get-fresh

Conversation

@binayshaw7777

@binayshaw7777 binayshaw7777 commented Nov 20, 2026 •

Copy link
Copy Markdown

Closes #555

Description

Calls to mutableStore.get(key) and mutableStore.fresh(key) failed compilation with Cannot infer type parameter Response because <Response : Any> was declared on the extension function without being present in parameters or return type.

This PR updates MutableStore.get() and MutableStore.fresh() to specify <Key : Any, Output : Any> and default the internal stream call to Unit. Callers can now use mutableStore.get(key) and mutableStore.fresh(key) without manually supplying unused generic parameters.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Test Plan

  • Added get_givenCachedData_returnsDataDirectlyWithoutExplicitResponseGeneric and fresh_givenFetcherData_returnsFreshDataDirectlyWithoutExplicitResponseGeneric in RealMutableStoreTest.kt.
  • Fixed local-to-output mapper in TestSourceOfTruth to avoid ClassCastException during test execution.
  • Added MutableStoreDeviceTest under androidDeviceTest verifying mutableStore.get() and fresh() without explicit response generic on real Android environment.
  • Verified test suite passes locally with:
    • ./gradlew :store:jvmTest (Pass)
    • ./gradlew :store:spotlessCheck (Pass)
    • ./gradlew :store:apiCheck (Pass)
    • ./gradlew :store:connectedAndroidDeviceTest on emulator-5554 (Pixel 10 / Android 17, Pass)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my change is effective
  • New and existing unit tests pass locally with my changes
  • DCO Signed-off-by included on all commits

…ileNativeFoundation#555)

- Remove unused <Response : Any> generic parameter from MutableStore.get() and fresh() extensions.
- Default internal stream calls to Unit to allow natural invocation without explicit generic arguments.
- Add unit tests in RealMutableStoreTest and connectedAndroidDeviceTest on emulator-5554.

Signed-off-by: Binay Shaw <binayshaw7777@gmail.com>
@binayshaw7777
binayshaw7777 force-pushed the binay/fix-mutablestore-get-fresh branch from 29dca00 to 93dc82b Compare November 21, 2026 10:50
@binayshaw7777 binayshaw7777 changed the title [DO NOT MERGE] Fix type inference for MutableStore.get() and fresh() extensions (#555) Fix type inference for MutableStore.get() and fresh() extensions (#555) Nov 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 Triage

Development

Successfully merging this pull request may close these issues.

[Feature Request] get() and fresh() extensions on MutableStore

1 participant