Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Reading the legacy storage format#64

Open
floriankrueger wants to merge 3 commits into
nickoneill:masterfrom
floriankrueger:feature/legacy_format
Open

Reading the legacy storage format#64
floriankrueger wants to merge 3 commits into
nickoneill:masterfrom
floriankrueger:feature/legacy_format

Conversation

@floriankrueger

Copy link
Copy Markdown

This PR enables Pantry to read its legacy storage format (plist). This is necessary when upgrading from a pre-swift-3 version of the framework a current version, otherwise the storage contents will always be tried to read as JSON (which will fail) and the unpack method will ultimately return nil although all the data was still there.

What this PR does is basically first trying to read the old format for downwards compatibility and only if that fails, read the storage contents as JSON.

You don't NEED to merge the PR if you don't want to as I can see this being a rare edge case but I wanted to offer it anyways. And I can totally see that 'reading the legacy format first' is a overhead that might be too big for the edge case it solves.

Also, I'm open for better approaches to fix this scenario if you have any. This is just a quick fix and honestly the first idea I had. But it works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant