-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added PersistableBundle extensions #174
Conversation
WalkthroughThe recent changes introduce an upgrade to the Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant PersistableBundle
participant SerializationLibrary
App->>PersistableBundle: putSerializable(key, value)
PersistableBundle->>SerializationLibrary: serialize(value)
SerializationLibrary-->>PersistableBundle: serializedValue
PersistableBundle-->>App: success
App->>PersistableBundle: getSerializable(key)
PersistableBundle-->>SerializationLibrary: deserialize(serializedValue)
SerializationLibrary-->>PersistableBundle: originalValue
PersistableBundle-->>App: originalValue
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- deps.versions.toml (1 hunks)
- state-keeper/api/android/state-keeper.api (1 hunks)
- state-keeper/src/androidMain/kotlin/com/arkivanov/essenty/statekeeper/PersistableBundleExt.kt (1 hunks)
- state-keeper/src/androidUnitTest/kotlin/com/arkivanov/essenty/statekeeper/AndroidStateKeeperTest.kt (3 hunks)
- state-keeper/src/androidUnitTest/kotlin/com/arkivanov/essenty/statekeeper/BundleExtTest.kt (2 hunks)
- state-keeper/src/androidUnitTest/kotlin/com/arkivanov/essenty/statekeeper/PersistableBundleExtTest.kt (1 hunks)
- state-keeper/src/androidUnitTest/kotlin/com/arkivanov/essenty/statekeeper/TestUtils.android.kt (1 hunks)
Additional comments not posted (24)
state-keeper/src/androidUnitTest/kotlin/com/arkivanov/essenty/statekeeper/TestUtils.android.kt (4)
13-19
: LGTM!The function correctly deserializes a
ByteArray
into aBundle
and ensures that the result is non-null.
21-25
: LGTM!The function correctly serializes a
PersistableBundle
into aByteArray
.
27-33
: LGTM!The function correctly deserializes a
ByteArray
into aPersistableBundle
and ensures that the result is non-null.
7-11
: LGTM!The function correctly serializes a
Bundle
into aByteArray
.state-keeper/src/androidUnitTest/kotlin/com/arkivanov/essenty/statekeeper/BundleExtTest.kt (3)
Line range hint
12-19
:
LGTM!The test correctly verifies that a
Serializable
object is correctly retrieved from aBundle
without serialization.
Line range hint
23-30
:
LGTM!The test correctly verifies that a
Serializable
object is correctly retrieved from aBundle
after serialization and deserialization.
Line range hint
33-43
:
LGTM!The test correctly verifies that a
Serializable
object is correctly retrieved from aBundle
after double serialization and deserialization.state-keeper/src/androidUnitTest/kotlin/com/arkivanov/essenty/statekeeper/PersistableBundleExtTest.kt (4)
13-21
: LGTM!The test correctly verifies that a
Serializable
object is correctly retrieved from aPersistableBundle
without serialization.
23-31
: LGTM!The test correctly verifies that a
Serializable
object is correctly retrieved from aPersistableBundle
after serialization and deserialization.
33-44
: LGTM!The test correctly verifies that a
Serializable
object is correctly retrieved from aPersistableBundle
after double serialization and deserialization.
46-47
: LGTM!The data class is correctly defined and used in the tests.
state-keeper/src/androidMain/kotlin/com/arkivanov/essenty/statekeeper/PersistableBundleExt.kt (4)
17-20
: LGTM!The
putSerializable
function correctly inserts a serializable value into aPersistableBundle
using the providedSerializationStrategy
.
27-29
: LGTM!The
getSerializable
function correctly retrieves a serializable value from aPersistableBundle
using the providedDeserializationStrategy
.
35-38
: LGTM!The
putSerializableContainer
function correctly inserts aSerializableContainer
into aPersistableBundle
using theSerializableContainer.serializer()
.
45-47
: LGTM!The
getSerializableContainer
function correctly retrieves aSerializableContainer
from aPersistableBundle
using theSerializableContainer.serializer()
.deps.versions.toml (1)
14-14
: Upgrade approved! Verify compatibility.The
robolectric
version has been updated from4.9.1
to4.13
. Ensure compatibility with the rest of the codebase.state-keeper/src/androidUnitTest/kotlin/com/arkivanov/essenty/statekeeper/AndroidStateKeeperTest.kt (4)
Line range hint
13-27
:
LGTM!The
saves_and_restores_state_without_parcelling
test function correctly verifies state saving and restoring without parcelling.
47-47
: LGTM!The
saves_and_restores_state_with_parcelling
test function correctly verifies state saving and restoring with parcelling. The change todeparcelizeBundle()
improves clarity and specificity.
Line range hint
49-61
:
LGTM!The
GIVEN_isSavingAllowed_is_false_on_save_THEN_state_not_saved
test function correctly verifies that state is not saved when saving is not allowed.
75-75
: LGTM!The
GIVEN_discardSavedState_is_true_on_restore_THEN_discards_saved_state
test function correctly verifies that saved state is discarded whendiscardSavedState
is true. The change todeparcelizeBundle()
improves clarity and specificity.state-keeper/api/android/state-keeper.api (4)
18-19
: Ensure proper error handling ingetSerializable
.The method
getSerializable
retrieves a serializable object from aPersistableBundle
. Ensure that the method handles cases where the key does not exist or the deserialization fails.
20-20
: Ensure proper error handling ingetSerializableContainer
.The method
getSerializableContainer
retrieves aSerializableContainer
from aPersistableBundle
. Ensure that the method handles cases where the key does not exist.
21-21
: Ensure proper error handling inputSerializable
.The method
putSerializable
inserts a serializable object into aPersistableBundle
. Ensure that the method handles cases where the serialization fails.
22-22
: Ensure proper error handling inputSerializableContainer
.The method
putSerializableContainer
inserts aSerializableContainer
into aPersistableBundle
. Ensure that the method handles cases where the container is null or invalid.
c673f69
to
195b1fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- state-keeper/api/android/state-keeper.api (1 hunks)
- state-keeper/src/androidMain/kotlin/com/arkivanov/essenty/statekeeper/PersistableBundleExt.kt (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- state-keeper/api/android/state-keeper.api
- state-keeper/src/androidMain/kotlin/com/arkivanov/essenty/statekeeper/PersistableBundleExt.kt
Summary by CodeRabbit
New Features
PersistableBundle
, enhancing state management in Android applications.Bug Fixes
robolectric
library, which may include various bug fixes and performance improvements.Tests
PersistableBundle
to ensure accurate serialization and deserialization across multiple scenarios.