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

Fix: context for afterFind #7078

Merged
merged 3 commits into from
Dec 18, 2020
Merged

Conversation

dblythy
Copy link
Member

@dblythy dblythy commented Dec 16, 2020

New Pull Request Checklist

Issue Description

Adds context to Parse.Cloud.afterFind

Related issue: #7058. Does not close this issue, but works towards.

Approach

Add context to Parse.Cloud.afterFind

@codecov
Copy link

codecov bot commented Dec 16, 2020

Codecov Report

Merging #7078 (02fb7f0) into master (97c3046) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7078      +/-   ##
==========================================
+ Coverage   93.63%   93.65%   +0.01%     
==========================================
  Files         169      169              
  Lines       12498    12499       +1     
==========================================
+ Hits        11703    11706       +3     
+ Misses        795      793       -2     
Impacted Files Coverage Δ
src/RestQuery.js 95.52% <100.00%> (+0.01%) ⬆️
src/rest.js 98.86% <100.00%> (ø)
src/triggers.js 94.60% <100.00%> (ø)
src/Controllers/SchemaController.js 97.13% <0.00%> (-0.20%) ⬇️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 95.85% <0.00%> (-0.08%) ⬇️
src/RestWrite.js 93.84% <0.00%> (+0.16%) ⬆️
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 93.51% <0.00%> (+0.67%) ⬆️

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 97c3046...02fb7f0. Read the comment docs.

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Can you please also add the changelog entry? Then it should be good for merge.

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for this PR 🙂

@dblythy I forgot the changelog entry, can you please add that and this should be ready to fly.

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Can you merge master into this branch to resolve the merge conflict?
Done.

@Moumouls Moumouls merged commit 41a052c into parse-community:master Dec 18, 2020
dplewis added a commit that referenced this pull request Feb 21, 2021
fix tests

Postgres Support

Update parse to 2.19.0 (#7060)

Fix Prettier (#7066)

Remove cache clear on validateObjects

Improve add class if not exist

Improve modifying schema instead of clearing

Improve enforce class exists

Fix flaky Test

Release 4.5.0 (#7070)

* Release 4.5.0

* Update CHANGELOG.md

Co-authored-by: Tom Fox <13188249+TomWFox@users.noreply.github.com>

* Improve braking change note

* Create a breaking changes sub-section

* Add release action

Co-authored-by: Tom Fox <13188249+TomWFox@users.noreply.github.com>

Improve issue templates & add PR template (#7051)

* improved feature suggestion template

* added test case chapter to bug report template

* PR wording

* added PR template

* improved formatting in issue template

* removed checkbox for concept due to new GH discussions process

* improved wording

* improved PR todo list

* amended PR checklist; minor rewording

* removed duplicate wording

* add securtiy check section to contribution guide

fix PR template file location (#7074)

Optimize redundant logic used in queries (#7061)

* Optimize redundant logic used in queries

* Added CHANGELOG

* Fixed comments and code style after recommendations.

* Fixed code style after recommendation.

* Improved explanation in comments

* Added tests to for logic optimizations

* Added two test cases more and some comments

* Added extra test cases and fixed issue found with them.

* Removed empty lines as requested.

Co-authored-by: Pedro Diaz <p.diaz@wemersive.com>

FileUpload options for Server Config (#7071)

* New: fileUpload options to restrict file uploads

* review changes

* update review

* Update helper.js

* added complete fileUpload values for tests

* fixed config validation

* allow file upload only for authenicated user by default

* fixed inconsistent error messages

* consolidated and extended tests

* minor compacting

* removed irregular whitespace

* added changelog entry

* always allow file upload with master key

* fix lint

* removed fit

Co-authored-by: Manuel Trezza <trezza.m@gmail.com>

Fix: context for afterFind (#7078)

* Fix: context for afterFind

* Update CHANGELOG.md

Co-authored-by: Manuel <trezza.m@gmail.com>

Fix max listener warning from livequery server (#7083)

* fix max listner warning

* fix

* Clean test log

Run definitions

pg fix

fix: upgrade ws from 7.4.0 to 7.4.1 (#7098)

Snyk has created this PR to upgrade ws from 7.4.0 to 7.4.1.

See this package in npm:
https://www.npmjs.com/package/ws

See this project in Snyk:
https://app.snyk.io/org/acinader/project/8c1a9edb-c8f5-4dc1-b221-4d6030a323eb?utm_source=github&utm_medium=upgrade-pr

fix: upgrade ldapjs from 2.2.2 to 2.2.3 (#7095)

Snyk has created this PR to upgrade ldapjs from 2.2.2 to 2.2.3.

See this package in npm:
https://www.npmjs.com/package/ldapjs

See this project in Snyk:
https://app.snyk.io/org/acinader/project/8c1a9edb-c8f5-4dc1-b221-4d6030a323eb?utm_source=github&utm_medium=upgrade-pr

fix: upgrade semver from 7.3.2 to 7.3.4 (#7092)

Snyk has created this PR to upgrade semver from 7.3.2 to 7.3.4.

See this package in npm:
https://www.npmjs.com/package/semver

See this project in Snyk:
https://app.snyk.io/org/acinader/project/8c1a9edb-c8f5-4dc1-b221-4d6030a323eb?utm_source=github&utm_medium=upgrade-pr

fix: upgrade uuid from 8.3.1 to 8.3.2 (#7101)

Snyk has created this PR to upgrade uuid from 8.3.1 to 8.3.2.

See this package in npm:
https://www.npmjs.com/package/uuid

See this project in Snyk:
https://app.snyk.io/org/acinader/project/8c1a9edb-c8f5-4dc1-b221-4d6030a323eb?utm_source=github&utm_medium=upgrade-pr
@matheusfrozzi
Copy link

matheusfrozzi commented Mar 17, 2021

Hey, I tried to use it as I use on beforeSave / afterSave.

On beforeFind I add:
request.context = { a: 'a' }

It's not available on afterFind, only works if I add the context in the .find() function.
But if I'm using beforeFind trigger I can't call .find().

It's possible to do it?

@dplewis
Copy link
Member

dplewis commented Mar 17, 2021

@matheusfrozzi I think you may have found a bug. I see a test for beforeFind and afterFind but not both together. Is this something you would like to work on? Can you open a new issue so we may track and investigate?

@matheusfrozzi
Copy link

I'm taking a look at the code right now, trying to find how to make it work.
I will open an issue.

I found in the ParseHoock.spec it:
it('should not set context on beforeFind', () => {

Saying that I'm not allowed to do what I'm trying to do. So I don't know if it was supposed to work.

@dblythy dblythy deleted the afterFind-context branch April 26, 2021 13:32
@matheusfrozzi
Copy link

Hey guys, I know I couldn't work on this one, but I think that fixing this issue of adding context in beforeFind that is not available on afterFind would be good before the new main release.

@mtrezza
Copy link
Member

mtrezza commented Oct 20, 2021

@matheusfrozzi Would you please open a new issue for this so that it’s on our radar? An additional PR with at least a failing test would be great, but even just the issue helps.

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Nov 1, 2021
@mtrezza mtrezza mentioned this pull request Mar 12, 2022
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants