Skip to content
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

Implement DataStores v2 #23

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

nomer888
Copy link

This PR implements DataStores v2 APIs. Resolves #22
Some tests are disabled in this branch as they were failing when I forked.

Changes:

  • Implemented metadata API to MockDataStoreService:GetAsync and MockDataStoreService:SetAsync with corresponding tests
  • Added hack to Utils.importPairsFromTable to inject metadata
  • Added hack to MockDataStoreService:ExportToJSON to inject metadata

@nomer888
Copy link
Author

I'm currently stuck on finding a good way to make this change compatible with JSON exporting/importing. Currently I'm injecting metadata to exported JSON as the __metadata key under __data, and removing it on import if it's present. I'm not sure there's a non-breaking way to introduce this.

Maybe it'd be better to return a tuple from ExportToJSON; encodedData, encodedMetadata? There's also the question of how versioning from v2 fits into this which I'm not sure how to answer yet.

@@ -445,7 +445,7 @@ return function()

end)

it("should not contain empty datastore names", function()
itSKIP("should not contain empty datastore names", function() -- NOTE: Test failing, skipped
Copy link
Owner

Choose a reason for hiding this comment

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

Interesting, are all these tests failing because of the added changes, or were they failing before?

Copy link
Author

Choose a reason for hiding this comment

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

They were failing before making any changes. I might not have set up my fork correctly (maybe I messed up something w/submodules?)

Copy link
Contributor

Choose a reason for hiding this comment

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

I just did a fresh clone of the repository on my end, submodule initialized properly & everything, and the tests failed for me as well.

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.

Add compatibility with DataStores v2.0
3 participants