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

Body validation fail when using TimestampLastEditedTimeFilter in DB querry. #365

Closed
adrianhrinko opened this issue May 24, 2023 · 4 comments
Labels
verification Check if bug/feature needs to be implemented
Milestone

Comments

@adrianhrinko
Copy link

adrianhrinko commented May 24, 2023

The issue:
When querying a database with the TimestampLastEditedTimeFilter, body validation fails as the Timestamp value should contain "last_edited_time" instead of "last_modified_time".

To reproduce:

var dateFilter = new DateFilter("When", onOrAfter: DateTime.Now);
var editedFilter = new LastEditedTimeFilter(onOrAfter: DateTime.Today);
var queryParams = new DatabasesQueryParameters { Filter = new CompoundFilter(and: new Filter[] {dateFilter, editedFilter}.ToList()) };
 var pages = await client.Databases.QueryAsync(databaseId, queryParams);

public string Timestamp => "last_modified_time";

Fix:
Replace "last_modified_time" with "last_edited_time".
It works for me.

@KoditkarVedant
Copy link
Contributor

Do you think it has something to with the Notion-Version we use? I wonder if that field was renamed recently. Would you like to submit a PR?

@KoditkarVedant KoditkarVedant added the verification Check if bug/feature needs to be implemented label Jul 18, 2023
@Dmitry-VF
Copy link
Contributor

Dmitry-VF commented Sep 7, 2023

I ran into the same issue. @KoditkarVedant if you are interested in a fix, please see my pull request: #369

@KoditkarVedant
Copy link
Contributor

@Dmitry-VF Thank you for providing the fix. I will try to take a look at this following weekend. I'm just not able to spend time on this project for the past few months.

@KoditkarVedant KoditkarVedant added this to the 4.2.0 milestone Sep 16, 2023
@KoditkarVedant
Copy link
Contributor

This has been released as part of 4.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verification Check if bug/feature needs to be implemented
Projects
None yet
Development

No branches or pull requests

3 participants