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

feat: add discardableResult to ParseObject methods #385

Merged
merged 5 commits into from
Jul 19, 2022
Merged

feat: add discardableResult to ParseObject methods #385

merged 5 commits into from
Jul 19, 2022

Conversation

vdkdamian
Copy link
Contributor

@vdkdamian vdkdamian commented Jul 16, 2022

New Pull Request Checklist

Issue Description

If you want to execute save() or fetch(),... the function returns the ParseObject. If you don't need it you need to cancel it out with an underscore replacement.

Related issue: #384

Approach

@discardableResult adds the possibility to skip the result as developer.
It's up to the developer to decide whether they use the result or not.

TODOs before merging

  • Add entry to changelog

@parse-github-assistant
Copy link

parse-github-assistant bot commented Jul 16, 2022

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@codecov
Copy link

codecov bot commented Jul 16, 2022

Codecov Report

Merging #385 (6a887e3) into main (b0bd351) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #385      +/-   ##
==========================================
- Coverage   89.66%   89.64%   -0.03%     
==========================================
  Files         155      155              
  Lines       14121    14121              
==========================================
- Hits        12662    12659       -3     
- Misses       1459     1462       +3     
Impacted Files Coverage Δ
...s/ParseSwift/Objects/ParseInstallation+async.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Objects/ParseObject+async.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Objects/ParseUser+async.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Objects/ParseUser.swift 86.12% <0.00%> (-0.18%) ⬇️
Sources/ParseSwift/Objects/ParseObject.swift 85.10% <0.00%> (-0.16%) ⬇️

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 b0bd351...6a887e3. Read the comment docs.

@vdkdamian
Copy link
Contributor Author

@cbaker6 Could you help me point why the tests are failing?
I tried running the tests on my mac, but I am on the Ventura Beta. The tests are failing on something I noticed since the beginning of the Beta's. All function like "saveAll", "fetchAll",... give me a warning. Might be a future problem when Ventura and iOS 16 release.

But I don't think that has anything to do with the little changes I made
Scherm­afbeelding 2022-07-17 om 23 23 27

@cbaker6
Copy link
Contributor

cbaker6 commented Jul 18, 2022

I wouldn’t worry about the failing tests on your system if they aren’t showing up in the CI. What does show in the CI looks like you didn’t lint the project after your changes. You will need to fix linting before this can be merged.

@vdkdamian
Copy link
Contributor Author

@cbaker6 I'm testing this line: ParseLiveQueryTests.testEventCreateSubscriptionCallback() and it was successful. I don't get why it fails here. Any ideas?

@cbaker6
Copy link
Contributor

cbaker6 commented Jul 19, 2022

I'm testing this line: ParseLiveQueryTests.testEventCreateSubscriptionCallback() and it was successful. I don't get why it fails here. Any ideas?

This is a random failure that only occurs in the CI so you can ignore.

Can you add @discardableResult to the equivalent methods in ParseInstallation and ParseUser?

CHANGELOG.md Outdated Show resolved Hide resolved
@cbaker6 cbaker6 linked an issue Jul 19, 2022 that may be closed by this pull request
3 tasks
@vdkdamian vdkdamian requested a review from cbaker6 July 19, 2022 11:12
@cbaker6 cbaker6 changed the title feat: add discardableResult to certain functions feat: add discardableResult to ParseObject methods Jul 19, 2022
@vdkdamian
Copy link
Contributor Author

Now something is wrong with linux?

Copy link
Contributor

@cbaker6 cbaker6 left a comment

Choose a reason for hiding this comment

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

LGTM

@cbaker6 cbaker6 merged commit 413e995 into parse-community:main Jul 19, 2022
@vdkdamian vdkdamian deleted the results branch July 20, 2022 21:26
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 discardableResult for certain functions
2 participants