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

AzureData.replace throwing partition key error #112

Closed
SogoGolf opened this issue Feb 10, 2019 · 3 comments · Fixed by #126
Closed

AzureData.replace throwing partition key error #112

SogoGolf opened this issue Feb 10, 2019 · 3 comments · Fixed by #126
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.

Comments

@SogoGolf
Copy link

Bug Information

Honestly i don't know if I am calling this part of the api correctly, but the behaviour I got today was when invoking AzureData.replace() the document was deleted from the collection.

Steps to Reproduce

Just to note updateId below is an existing documents id

Here's the code:

  AzureData.get (documentWithId: updateId, as: GolferDocument.self, inCollection: "sogocollection",      
       inDatabase: "sogodb") { r in
	let doc = r.resource

       //just change the first name property
	doc?.firstName = "new fname \(timestamp)"

        //now replace that document
	AzureData.replace (doc!, inCollection: "sogocollection", inDatabase: "sogodb") { r in
		print(r.resource)
		print(r.error)
	}
    }

Expected Behavior

document is updated

Actual Behavior

document was deleted

@ftchirou ftchirou self-assigned this Feb 10, 2019
@colbylwilliams
Copy link
Member

@SogoGolf can you confirm this is still happening in v0.4.0 (latest cocoapod released)?

@colbylwilliams colbylwilliams added bug This issue requires a change to an existing behavior in the product in order to be resolved. AzureData labels May 22, 2019
@SogoGolf
Copy link
Author

hey @colbylwilliams ill look to test 0.4.0 tomorrow and will post back here

@SogoGolf
Copy link
Author

.replace(... is no longer deleting the document. however it fails now with a "partition key header" error. so that should be fixed.

also just to note, .createOrReplace does work (replaces the doc correctly and does not throw a partition key error)

@colbylwilliams colbylwilliams added this to the v0.4.1 milestone May 24, 2019
@colbylwilliams colbylwilliams changed the title AzureData.replace is *deleting* doc instead AzureData.replace throwing partition key error May 24, 2019
colbylwilliams added a commit that referenced this issue May 24, 2019
colbylwilliams added a commit that referenced this issue May 24, 2019
fix issue #112 : AzureData.replace throwing partition key error
@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants