-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Incorrect date type in LiveQuery #8005
Comments
Thanks for opening this issue!
|
Possibly related to #7082 |
@catalunha Could you confirm that this issue has been fixed? A related issue has been fixed, see #7082. |
Hello @mtrezza , thank you for your attention. |
Hello @mtrezza ,
But after an update it returns as a string. See below:
I changed to Parse Version 5.2.3 and the same thing happens. |
Thanks for testing, does this still occur with the latest alpha version of Parse Server? Maybe you could just submit a PR with a failing test so we can better see what this is about. |
How I would like to have a little more knowledge to cooperate with you in this incredible journey of mutual cooperation in such an interesting project that is Parse. I'm really excited about him. |
Could you provide a minimal code example that others can run to replicate the issue? |
Here it is. Is it enough? package.json {
"dependencies": {
"parse": "^3.5.1"
},
"name": "youB4AAppName",
"version": "1.0.0",
"main": "index.js",
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": ""
} ./index.js const Parse = require('parse/node');
Parse.serverURL = 'https://youB4AAppName.b4a.io';
Parse.initialize('applicationId','javaScriptKey');
const main = async ()=>{
const query = new Parse.Query('Genre');
query.exists('typeDateTime');
const subscribe = await query.subscribe();
let contacts = {};
const printContacts = ()=>{
console.log('printContacts+++');
Object.keys(contacts).forEach(id=>{
console.log(contacts[id].toJSON());
console.log(contacts[id].get('typeDateTime'))
console.log(typeof contacts[id].get('typeDateTime'))
});
console.log('printContacts---');
};
subscribe.on('open', async ()=>{
console.log('open...');
contacts = (await query.find()).reduce((contacts,contact)=>({
...contacts,
[contact.id]: contact
}),contacts);
printContacts();
});
subscribe.on('create',(data)=>{
console.log(`Data: ${data.id} | create...`);
contacts[data.id]=data;
printContacts();
});
subscribe.on('update',(data)=>{
console.log(`Data: ${data.id} | update...`);
contacts[data.id]=data;
printContacts();
});
subscribe.on('enter',(data)=>{
console.log(`Data: ${data.id} | enter...`);
contacts[data.id]=data;
printContacts();
});
subscribe.on('leave',(data)=>{
console.log(`Data: ${data.id} | leave...`);
delete contacts[data.id];
printContacts();
});
subscribe.on('delete',(data)=>{
console.log(`Data: ${data.id} | delete...`);
delete contacts[data.id];
printContacts();
});
subscribe.on('closed',()=>{
console.log('closed...');
});
};
main(); running.
|
Yes thanks, could you try this with the latest versions of Parse Server and the Parse Flutter SDK? We want to make sure the bug hasn't been fixed already. |
🎉 This change has been released in version 6.1.0-alpha.5 |
🎉 This change has been released in version 6.1.0-beta.2 |
🎉 This change has been released in version 6.1.0 |
New Issue Checklist
Issue Description
if I build this query:
query.exists('birthDate');
See the output:catalunha@pop-os:~/myapp/contactlist01js$ node index.js
As the column/field is involved in the query, Parse returns it in String format and not Date.
Strange agree?
Steps to reproduce
Actual Outcome
But Parse's default Date format is:
birthDate: { __type: 'Date', iso: '2022-05-11T23:48:00.000Z' },
Just because this column goes to query it has another type, in this case String ?
birthDate: '2022-05-12T00:25:00.000Z',
I find this complicated!
Because regardless of my consumption it is reporting data in different formats. Do you agree?
Expected Outcome
In any case, inside or outside of liveQuery, the date format is:
birthDate: { __type: 'Date', iso: '2022-05-11T23:48:00.000Z' },
Environment
Parse Flutter SDK
parse_server_sdk_flutter: ^3.1.0
Linux PopOS
Server
I'm using back4app.com
4.5.0
Logs
There is no error. Just the return with different types.
The text was updated successfully, but these errors were encountered: