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

Support incrementing push badge value by more than 1 #4889

Merged
merged 5 commits into from
Jul 12, 2018

Conversation

rdbayer
Copy link
Contributor

@rdbayer rdbayer commented Jul 12, 2018

No description provided.

@codecov
Copy link

codecov bot commented Jul 12, 2018

Codecov Report

Merging #4889 into master will increase coverage by 0.02%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4889      +/-   ##
==========================================
+ Coverage   92.85%   92.88%   +0.02%     
==========================================
  Files         119      119              
  Lines        8821     8828       +7     
==========================================
+ Hits         8191     8200       +9     
+ Misses        630      628       -2
Impacted Files Coverage Δ
src/Push/utils.js 100% <100%> (ø) ⬆️
src/Controllers/PushController.js 97.82% <66.66%> (+0.04%) ⬆️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 97.29% <0%> (+0.08%) ⬆️
src/Adapters/Auth/meetup.js 89.47% <0%> (+5.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 800959f...ba86f9c. Read the comment docs.

Copy link
Contributor

@flovilmart flovilmart left a comment

Choose a reason for hiding this comment

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

Can we make it an object instead of a string to parse? badge: { increment: 3 }

parseInt(badge.substring(incrementby.length), 10) > 0) {
restUpdate = { badge: { __op: 'Increment', amount: parseInt(badge.substring(incrementby.length), 10) } }
} else if (typeof badge == 'object' && 'increment' in badge && Number(badge.increment)) {
restUpdate = { badge: { __op: 'Increment', amount: badge.increment } }
Copy link
Contributor

Choose a reason for hiding this comment

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

@rdbayer @dplewis what do you think if we use the __op form instead of the one I just suggested? This is more consistent with the rest of the API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you're talking about using it but only supporting the "increment" case, I'm happy to make the changes.

If you mean more broadly supporting all the same operations, I don't understand all the ramifications well enough myself to be confident in implementing that (I'm fairly new to the code base and likely don't have the time right now to get up to speed on all those different flows)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, for now that would be just for the increment. Sorry for the back and forths. I believe if we use the same JSON based objects as the rest of the API we’ll be happier on the long term

@rdbayer rdbayer changed the title Support 'IncrementByN' badge value for higher push badge increments Support incrementing push badge value by more than 1 Jul 12, 2018
@flovilmart
Copy link
Contributor

Awesome! Thanks for the PR and sticking with the change requests :)

@flovilmart flovilmart merged commit ced6b76 into parse-community:master Jul 12, 2018
flovilmart pushed a commit that referenced this pull request Aug 12, 2018
* Support 'IncrementByN' badge value for higher push badge increments

* Fix test

* Rely on object for badge incrementation (i.e. {increment: 3}) rather than string (IncrementBy3)

* For badge incrementation, utilize format similar to other operation notation
flovilmart pushed a commit that referenced this pull request Aug 12, 2018
* Support 'IncrementByN' badge value for higher push badge increments

* Fix test

* Rely on object for badge incrementation (i.e. {increment: 3}) rather than string (IncrementBy3)

* For badge incrementation, utilize format similar to other operation notation
UnderratedDev pushed a commit to UnderratedDev/parse-server that referenced this pull request Mar 21, 2020
…#4889)

* Support 'IncrementByN' badge value for higher push badge increments

* Fix test

* Rely on object for badge incrementation (i.e. {increment: 3}) rather than string (IncrementBy3)

* For badge incrementation, utilize format similar to other operation notation
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.

2 participants