Skip to content

#6101 Let users define objectId #6177

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

Merged
merged 15 commits into from
Dec 17, 2019
Merged

#6101 Let users define objectId #6177

merged 15 commits into from
Dec 17, 2019

Conversation

rhuanbarreto
Copy link
Contributor

This PR is a start of an idea discussed on issue #6101. Was created as a recommendation by @dplewis

This commit was a try to enable the generation of IDs on client-side.

I'm don't have much knowledge on Parse, but if someone give me guidance, I can do all the work.

@davimacedo
Copy link
Member

Can you please take a look at the failing tests?

@rhuanbarreto
Copy link
Contributor Author

I will do! I will try to work on this this week.

@JeromeDeLeon
Copy link
Contributor

@rhuanbarreto you can start off by checking the failing test in CI. I tried pushing changes but got denied.

@rhuanbarreto
Copy link
Contributor Author

I opened my repository to edits publicly. I also merged your changes into the branch in this PR.

@codecov
Copy link

codecov bot commented Dec 9, 2019

Codecov Report

Merging #6177 into master will decrease coverage by 2.82%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6177      +/-   ##
==========================================
- Coverage   93.81%   90.99%   -2.83%     
==========================================
  Files         167      169       +2     
  Lines       11299    11957     +658     
==========================================
+ Hits        10600    10880     +280     
- Misses        699     1077     +378
Impacted Files Coverage Δ
src/Options/index.js 100% <ø> (ø) ⬆️
src/Options/Definitions.js 100% <ø> (ø) ⬆️
src/RestWrite.js 93.79% <100%> (-0.13%) ⬇️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 74.98% <0%> (-22.11%) ⬇️
src/GraphQL/helpers/objectsQueries.js 90.35% <0%> (-7.69%) ⬇️
src/GraphQL/transformers/constraintType.js 86.95% <0%> (-7.49%) ⬇️
src/ParseServer.js 91.56% <0%> (-6.03%) ⬇️
src/middlewares.js 97.17% <0%> (-1.12%) ⬇️
src/Adapters/Auth/twitter.js 96% <0%> (-0.43%) ⬇️
src/GraphQL/loaders/parseClassTypes.js 94.23% <0%> (-0.25%) ⬇️
... and 33 more

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 4a5fed8...b267d16. Read the comment docs.

@JeromeDeLeon
Copy link
Contributor

@rhuanbarreto Can you verify the failing test? I can't seem to run mongodb-runner on my end. Thanks.

Copy link
Member

@davimacedo davimacedo left a comment

Choose a reason for hiding this comment

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

It looks good to me. @dplewis @acinader thoughts?

@dplewis
Copy link
Member

dplewis commented Dec 17, 2019

@davimacedo I want to try something. It looks good to me.

Copy link
Member

@dplewis dplewis left a comment

Choose a reason for hiding this comment

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

LGTM! @BufferUnderflower @rhuanbarreto @JeromeDeLeon Thanks for working together to get this done!

@dplewis dplewis merged commit 8bc201d into parse-community:master Dec 17, 2019
@rhuanbarreto rhuanbarreto deleted the patch-1 branch January 13, 2020 12:13
UnderratedDev pushed a commit to UnderratedDev/parse-server that referenced this pull request Mar 21, 2020
* parse-community#6101 Let users define objectId

* Add `allowCustomObjectId` to PS Option

* Add checking in objectId creation

* Add test

* Update docs

* Update definition

* Change default to false

* throw on empty, null, undefined

* better tests

* unused async

* removed comment

* retain comment

* Linting fix according to contributing spec.
@TanzimChowdhury
Copy link

TanzimChowdhury commented Jun 20, 2020

Hello , i've changed the allowCustomObjectId to true in server settings in back4app. I can create a new object with custom Id through REST API. But when I try to do it through cloud code i get this error
{ "code": 101, "error": "Object not found." }
My cloud is is as follows:

const GameScore = Parse.Object.extend("GameScore");
const gameScore = new GameScore();
gameScore.set("objectId", "8YgwDJ19qX");
gameScore.set("name","nat");
return await gameScore.save(null,{useMasterKey:true});

Help would be really appreciated.

@JeromeDeLeon
Copy link
Contributor

Hello, your concern is duplicate of #6733.

@TanzimChowdhury
Copy link

Yes it seem's like my concern is a duplicate , do you think this will be resolved anytime soon ?

@JeromeDeLeon
Copy link
Contributor

not at the moment. You could use http request inside cloud code to support your use case.

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.

6 participants