Skip to content

Incrementing or Decrementing a value and then calling get returns _Map<String, dynamic> #842

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

Closed
4 tasks done
Nidal-Bakir opened this issue Mar 4, 2023 · 3 comments
Closed
4 tasks done
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@Nidal-Bakir
Copy link
Member

New Issue Checklist

Issue Description

Incrementing or Decrementing a value using setDecrement(key,amount) or setIncrement(key,amount) and then calling get(key) returns _Map<String, dynamic>

related to: #834, #696

Steps to reproduce

  1. create ParseObject
  2. increment or decrement a value using setIncrement or setDecrement functions
  3. get the value using the value key with get("key")
  4. the result of calling get("key") is Map which is not expected

code snippet:

final dietPlansObject = ParseObject("Diet_Plans");

final anyAmount = 1;
dietPlansObject.setIncrement("key", anyAmount);
// dietPlansObject.setDecrement("key", anyAmount);

final value = dietPlansObject.get("key");

print(value.runtimeType); // _Map<String, dynamic>

Actual Outcome

_Map<String, dynamic>

Expected Outcome

num

Environment

Parse Flutter SDK

  • SDK version: 3.1.15
  • Operating system version: any

Server

  • Parse Server version: any

Logs

From tests error:

Expected: <Instance of 'num'>
Actual: {'__op': 'Increment', 'amount': 1.0}
Which: is not an instance of 'num'
package:test_api expect
test/src/objects/parse_object_test.dart 1180:11 main...

@parse-github-assistant
Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@Nidal-Bakir Nidal-Bakir added the type:bug Impaired feature or lacking behavior that is likely assumed label Mar 4, 2023
@Nidal-Bakir Nidal-Bakir self-assigned this Mar 11, 2023
@mtrezza
Copy link
Member

mtrezza commented Mar 12, 2023

@Nidal-Bakir I'm removing you from all issues as assignee. We do not use the assignment feature.

@Nidal-Bakir
Copy link
Member Author

Fix via #860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants