Skip to content

MS-628 LibSimprints API versioning support#100

Merged
luhmirin-s merged 6 commits into
mainfrom
feature/MS-628-version-meta-info
Aug 22, 2024
Merged

MS-628 LibSimprints API versioning support#100
luhmirin-s merged 6 commits into
mainfrom
feature/MS-628-version-meta-info

Conversation

@luhmirin-s
Copy link
Copy Markdown
Contributor

After running the different versions of LibSimprints (pre-refactoring and post-refactoring) against the same SID version (that integrates the post-refactoring version) I realised that Parcel is a completely inadequate way to send data. The main reason is the strict requirement for marshalling/unmarshalling the data object based on the class version, i.e. adding/removing fields to a class breaks compatibility.

To fix this issue I have implemented a few crucial changes:

  • Restored pre-refactoring models to the same structure (except now in Kotlin) including the manual parcelization. This allows SID to return pre-refactoring data classes if the intent does not include the LibSimprints version number.
  • Implement a new set of the response data classes (in an appropriate subpackage) explicitly for the contracts API.
  • New data classes use JSON as an intermediate format to ensure that adding/removing fields can be handled gracefully on both LibSimprints and SID sides of the communication.
  • Detect the LibSimprints version in SID and starting from the LibSimprints v2024.08.01 return the new JSON data classes.

@luhmirin-s luhmirin-s requested review from a team, BurningAXE, TristramN, alex-vt, alexandr-simprints, meladRaouf and ybourgery and removed request for a team August 21, 2024 14:22
@luhmirin-s luhmirin-s changed the base branch from feature/MS-621-contracts to main August 22, 2024 08:24
@luhmirin-s luhmirin-s changed the base branch from main to feature/MS-621-contracts August 22, 2024 08:25
val CREATOR = object : Creator<Identification> {

override fun createFromParcel(parcel: Parcel): Identification? {
val guid = parcel.readString().orEmpty()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you confirmed that createFromParcel is working as expected? I remember having fun with it back in the days

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per slack conversation - I have integrated this version in SID and then tried calling from the current "main" version of Intent Launcher (it still uses java version of LibSimprints). So I am fairly confident that it works correctly.

Base automatically changed from feature/MS-621-contracts to main August 22, 2024 10:51
An error occurred while trying to automatically change base from feature/MS-621-contracts to main August 22, 2024 10:51
@luhmirin-s luhmirin-s force-pushed the feature/MS-628-version-meta-info branch from 75bd9da to 0e41224 Compare August 22, 2024 10:53
@luhmirin-s luhmirin-s merged commit ab315ad into main Aug 22, 2024
@luhmirin-s luhmirin-s deleted the feature/MS-628-version-meta-info branch August 22, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants