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

DatastoreDb.Insert() sometimes returns null. #722

Closed
SurferJeffAtGoogle opened this issue Jan 26, 2017 · 6 comments
Closed

DatastoreDb.Insert() sometimes returns null. #722

SurferJeffAtGoogle opened this issue Jan 26, 2017 · 6 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. release blocking Required feature/issue must be fixed prior to next release.

Comments

@jskeet jskeet added the api: datastore Issues related to the Datastore API. label Jan 27, 2017
@jskeet
Copy link
Collaborator

jskeet commented Jan 27, 2017

The test is certainly confusing and needs changing.

The behaviour matches the underlying API, however - I would be somewhat reluctant to completely mask that, both for consistency with other platforms and because it may well be useful behaviour. (Aside from anything else, it would be odd for a user to read the API documentation and then get very different behaviour from the library.)

@pcostell Do you have examples of where it's particularly useful to distinguish between allocated keys and client-provided keys? If we could add something into our library docs, that would be great.

@jskeet
Copy link
Collaborator

jskeet commented Jan 27, 2017

Ah, I hadn't noticed that the test is in your samples rather than in my repo :) I would take issue of your claim of "should" in the test, as the code is behaving exactly as documented.

@danoscarmike danoscarmike added this to Cloud Datastore in First 4 (GA) Feb 21, 2017
@jskeet
Copy link
Collaborator

jskeet commented Mar 1, 2017

Ping for further input from @SurferJeffAtGoogle or @pcostell.

(Marked as release blocking because changing it later would be a breaking change.)

@jskeet jskeet added the release blocking Required feature/issue must be fixed prior to next release. label Mar 1, 2017
@pcostell
Copy link

pcostell commented Mar 1, 2017

I believe this is just for reduced network traffic. There is no need for us to tell you about the keys you already know about.

From the user point of view, there isn't really any difference between the two. Where it can be important is if you do some sort of:

a = EntityWithIncompleteKey()
commit(a)
a.foo = "bar"
commit(a)

You'll end up accidentally creating two entities, rather than 1. Most of our libraries have modified commit so that when you call commit(a) it will mutate a to store the key. That way, later modifications to a will ensure it is the same entity.

@jskeet
Copy link
Collaborator

jskeet commented Mar 1, 2017

Just reopening for now - the "most of our libraries" comment from Patrick sounds like it may be something we want to do... although of course it makes for interesting things around asynchrony.

Jeffrey: I'm assuming your closing aspect was around the returning of the keys? Do you think you'd expect and/or like the entities to be mutated after commit? (It feels slightly surprising to me, but I can see it being handy.) If we're happy on the return front but want to explore the mutation side, I'll create a separate issue for that.

@jskeet
Copy link
Collaborator

jskeet commented Mar 13, 2017

Reclosing this, so a new issue can focus on whether to update key properties.

@jskeet jskeet closed this as completed Mar 13, 2017
gcf-owl-bot bot added a commit that referenced this issue Jun 2, 2022
Source-Link: googleapis/googleapis@950dd73

Source-Link: googleapis/googleapis-gen@57ace17
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQ29tcHV0ZS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiNTdhY2UxNzhjODU0M2M0NDYyNzgyMzA0NTkxNzgyMGQ2N2I0OTBjMSJ9
gcf-owl-bot bot added a commit that referenced this issue Jun 2, 2022
Source-Link: googleapis/googleapis@950dd73

Source-Link: googleapis/googleapis-gen@57ace17
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQ29tcHV0ZS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiNTdhY2UxNzhjODU0M2M0NDYyNzgyMzA0NTkxNzgyMGQ2N2I0OTBjMSJ9
jskeet pushed a commit that referenced this issue Jun 2, 2022
Source-Link: googleapis/googleapis@950dd73

Source-Link: googleapis/googleapis-gen@57ace17
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQ29tcHV0ZS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiNTdhY2UxNzhjODU0M2M0NDYyNzgyMzA0NTkxNzgyMGQ2N2I0OTBjMSJ9
jskeet added a commit to jskeet/google-cloud-dotnet that referenced this issue Jun 8, 2022
Changes in this release:

This is the first version of this package to depend on GAX v4.

There are some breaking changes, both in GAX v4 and in the generated
code. The changes that aren't specific to any given API are [described in the Google Cloud
documentation](https://cloud.google.com/dotnet/docs/reference/help/breaking-gax4).
We don't anticipate any changes to most customer code, but please [file a
GitHub issue](https://github.com/googleapis/google-cloud-dotnet/issues/new/choose)
if you run into problems.

The most important change in this release is the use of the Grpc.Net.Client package
for gRPC communication, instead of Grpc.Core. When using .NET Core 3.1 or .NET 5.0+
this should lead to a smaller installation footprint and greater compatibility (e.g.
with Apple M1 chips). Any significant change in a core component comes with the risk
of incompatibility, however - so again, please let us know if you encounter any
issues.

### New features

- Update Compute Engine API to revision 20220526 ([issue 722](googleapis#722)) ([commit 5d75c04](googleapis@5d75c04))
gcf-merge-on-green bot pushed a commit that referenced this issue Jun 8, 2022
Changes in this release:

This is the first version of this package to depend on GAX v4.

There are some breaking changes, both in GAX v4 and in the generated code. The changes that aren't specific to any given API are [described in the Google Cloud documentation](https://cloud.google.com/dotnet/docs/reference/help/breaking-gax4). We don't anticipate any changes to most customer code, but please [file a GitHub issue](https://github.com/googleapis/google-cloud-dotnet/issues/new/choose) if you run into problems.

The most important change in this release is the use of the Grpc.Net.Client package for gRPC communication, instead of Grpc.Core. When using .NET Core 3.1 or .NET 5.0+ this should lead to a smaller installation footprint and greater compatibility (e.g. with Apple M1 chips). Any significant change in a core component comes with the risk of incompatibility, however - so again, please let us know if you encounter any issues.

### New features

- Update Compute Engine API to revision 20220526 ([issue 722](#722)) ([commit 5d75c04](5d75c04))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. release blocking Required feature/issue must be fixed prior to next release.
Projects
No open projects
First 4 (GA)
Cloud Datastore
Development

No branches or pull requests

3 participants