Skip to content

Added relative date support to OfflineQuery class #1341

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

Closed
wants to merge 3 commits into from

Conversation

zanderisrael
Copy link
Contributor

Since $relativeTime is supported by parse-server backend, and are possible to construct using the parse-sdk-js lib, iv added the support to the OfflineQuery class so this type of query is available when querying local pinned objects.

construction of a $relativeTime query:

const obj = new ParseObject('Item');
obj.set('field', date);
const q = new ParseQuery('Item');
q.lessThanOrEqualTo('field', { $relativeTime: 'in 0 day' }); 

@dplewis
Copy link
Member

dplewis commented Apr 12, 2021

@zanderisrael
Copy link
Contributor Author

@zanderisrael
Copy link
Contributor Author

@dplewis
Copy link
Member

dplewis commented Apr 13, 2021

@mtrezza The build is failing because of the S3 change. Can you look into it?

@@ -1903,67 +1903,6 @@
}
}
},
"@parse/s3-files-adapter": {
Copy link
Member

Choose a reason for hiding this comment

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

@zanderisrael Can you revert the package-lock.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just deleted the package-lock.json file, Im not really sure why this is being tracked in the first place...
It should be gitignored since the package.json file is what we need, the lock file is generated per environment when npm installing...

Copy link
Member

@mtrezza mtrezza Apr 13, 2021

Choose a reason for hiding this comment

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

@zanderisrael, it is common practice to commit package-lock. It prevents unexpected behavior because it fixates dependencies to a specific version/commit. Without committing it, every installation of Parse Server could vary in its dependencies. You would just need to regenerate the file locally and commit it. The CI will then check if the new dependencies pass the tests.

@mtrezza
Copy link
Member

mtrezza commented Apr 13, 2021

@dplewis From a quick look on mobile I think any dependency on the S3 adapter should be removed from the JS SDK.

The solution would be to remove any dependency in package.json and rebuild package-lock.json. If there are tests that need an adapter, then the mock adapter in Parse Server should be used. Require mock-storage-adapter.

@mtrezza
Copy link
Member

mtrezza commented Apr 13, 2021

@zanderisrael You would need to delete package-lock, run npm i to generate a new file, then commit.

@zanderisrael
Copy link
Contributor Author

@zanderisrael You would need to delete package-lock, run npm i to generate a new file, then commit.

ok np.

@mtrezza
Copy link
Member

mtrezza commented Apr 13, 2021

Has there been a misunderstanding or has this PR been abandoned?

@zanderisrael
Copy link
Contributor Author

Has there been a misunderstanding or has this PR been abandoned?

I created a new one. I have little experience with OSS projects, sorry if I'm making a mess...

@mtrezza
Copy link
Member

mtrezza commented Apr 13, 2021

I see, actually all that was necessary was to delete the package-lock file (as you already did), then run npm i which will create a new package-lock file. That new file would make the tests pass.

@zanderisrael
Copy link
Contributor Author

I see, actually all that was necessary was to delete the package-lock file (as you already did), then run npm i which will create a new package-lock file. That new file would make the tests pass.

actually did that on new PR, but still tests don't pass :(

@mtrezza
Copy link
Member

mtrezza commented Apr 13, 2021

Can you upload the PR so we can have a look at the errors.

@zanderisrael
Copy link
Contributor Author

Can you upload the PR so we can have a look at the errors.

#1344

@zanderisrael
Copy link
Contributor Author

Hey about this, id like to support start of day, and end of day. In current implementation you can't set a range that is relative to today (not now)

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.

3 participants