Skip to content

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

Closed
@Nidal-Bakir

Description

@Nidal-Bakir

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions