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

getData method does not work with putFile #39

Open
jbadger3 opened this issue Oct 8, 2024 · 1 comment
Open

getData method does not work with putFile #39

jbadger3 opened this issue Oct 8, 2024 · 1 comment

Comments

@jbadger3
Copy link

jbadger3 commented Oct 8, 2024

It looks like the current getData method mock_storage_reference.dart only looks at the storedDataMap.

  Future<Uint8List?> getData([int maxSize = 10485760]) {
    return Future.value(_storage.storedDataMap[_path]);
  }

Shouldn't this method look similar to the delete method and also check storedFilesMap?

I've run into some issues when trying to use putFile instead of putData.

@atn832
Copy link
Owner

atn832 commented Oct 15, 2024

You're right. We could either make getData look at storedFilesMap and storedStringMap like the rest of the code, or consolidate all 3 maps into one Map<String, Uint8List> storedData. If we consolidate all 3 maps into one, putFile, putData and putString would store into that and it simplifies the rest of the code. The latter seems cleaner, but would require a bit more work.

I'm not sure when I could tackle this. If you can propose a PR though, I'll be happy to review it and publish it!

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

No branches or pull requests

2 participants