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

Add updated at and created at to index #170

Merged

Conversation

sander1095
Copy link
Contributor

@sander1095 sander1095 commented Oct 13, 2021

This PR attempts to add the UpdatedAt and CreatedAt properties to the dotnet library.

Resolves #162

@sander1095
Copy link
Contributor Author

sander1095 commented Oct 13, 2021

You can see the unit tests fail.

Also, when I run the project locally when I get the following error when trying to create a new index:

Json deserialize error: unknown field `updatedAt`, expected `uid` or `primaryKey` at line 1 column 59,

I am kinda confused and stuck with this, I thought the server would already be updated and ready for these properties?

Any guidance would be appreciated.

/cc @curquiza could you be of any assistance? I will also post this question in the Slack for help of other (community) members :)

@sander1095
Copy link
Contributor Author

Carolina told me I could also ping

/cc @alallema

@alallema
Copy link
Contributor

alallema commented Oct 14, 2021

You can see the unit tests fail.

Also, when I run the project locally when I get the following error when trying to create a new index:

Json deserialize error: unknown field `updatedAt`, expected `uid` or `primaryKey` at line 1 column 59,

I am kinda confused and stuck with this, I thought the server would already be updated and ready for these properties?

Any guidance would be appreciated.

/cc @curquiza could you be of any assistance? I will also post this question in the Slack for help of other (community) members :)

Hi @sander1095,
I think the confusion came from these two fields updateAt and createdAt are generated by Meilisearch API, so you can GET them but the Json deserialize error means that you try to POST them to Meilisearch when you can't.
I let you check the documentation to see the difference between get and create.
The updatedAt and createdAt should be in the Index class but maybe not in the Index function depending on how the SDK is made.

@sander1095
Copy link
Contributor Author

Thanks, that might just give me enough info to look further into this! Expect more updates this evening or perhaps this weekend

@sander1095 sander1095 marked this pull request as ready for review October 14, 2021 18:00
@sander1095
Copy link
Contributor Author

sander1095 commented Oct 14, 2021

Hello @alallema ! I have been able to resolve the issue, thanks to your quick reply!

I am curious about your review! I know Carolina said you people are very busy, but I can't resist asking 🙈 !

Thanks for the opportunity to create this PR! It was fun! :)

Copy link
Member

@curquiza curquiza 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 also updat UpdateIndex() in the Index class as you updated FetchInfo()? :) Thanks

@curquiza
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Oct 18, 2021
@bors
Copy link
Contributor

bors bot commented Oct 18, 2021

try

Build failed:

@curquiza
Copy link
Member

looks like the tests do not pass anymore, small changes might be needed :)

@sander1095
Copy link
Contributor Author

@curquiza I have made the requested changes 🥳

@bors
Copy link
Contributor

bors bot commented Oct 18, 2021

🔒 Permission denied

Existing reviewers: click here to make sander1095 a reviewer

@sander1095
Copy link
Contributor Author

I tried doing bors try but I don't have permission :)

@curquiza
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Oct 18, 2021
@bors
Copy link
Contributor

bors bot commented Oct 18, 2021

try

Build succeeded:

I also decided to not override the camelcase property if a user specified different JSON settings because they might override them for a specific reason. OVerriding their choices seem counter intuitive
Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

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

Please don't modify PrepareJsonPayload, we don't want the IgnoreNullValues option be applied to every call :)

Also, it seems to have some git conflict you need to solve before I can review again!

thank you again for your involvement!

Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

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

Thank you so much @sander1095

bors merge

I think I already sent the form link, but just in case:
If you are participating in Hacktoberfest, and you would like to receive a small gift from MeiliSearch too, please complete this form.

@curquiza
Copy link
Member

bors merge-

@bors
Copy link
Contributor

bors bot commented Oct 19, 2021

Canceled.

@curquiza
Copy link
Member

bors merge

bors bot added a commit that referenced this pull request Oct 19, 2021
170: Add updated at and created at to index r=curquiza a=sander1095

This PR attempts to add the `UpdatedAt` and `CreatedAt` properties to the dotnet library.

Resolves #162 

Co-authored-by: Sander ten Brinke <s.tenbrinke2@gmail.com>
Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
bors bot added a commit that referenced this pull request Oct 19, 2021
170: Add updated at and created at to index r=curquiza a=sander1095

This PR attempts to add the `UpdatedAt` and `CreatedAt` properties to the dotnet library.

Resolves #162 

Co-authored-by: Sander ten Brinke <s.tenbrinke2@gmail.com>
Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
@curquiza
Copy link
Member

Since bors seems to be broken I merge manually.

@curquiza curquiza merged commit cec9487 into meilisearch:main Oct 19, 2021
bors bot added a commit that referenced this pull request Oct 19, 2021
170: Add updated at and created at to index r=curquiza a=sander1095

This PR attempts to add the `UpdatedAt` and `CreatedAt` properties to the dotnet library.

Resolves #162 

Co-authored-by: Sander ten Brinke <s.tenbrinke2@gmail.com>
Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
@curquiza curquiza added the enhancement New feature or request label Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add updatedAt and createdAt to Index
3 participants