Skip to content

Array of Dates are saved as array of Strings #3591

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
hipwelljo opened this issue Mar 3, 2017 · 5 comments
Closed

Array of Dates are saved as array of Strings #3591

hipwelljo opened this issue Mar 3, 2017 · 5 comments

Comments

@hipwelljo
Copy link

hipwelljo commented Mar 3, 2017

Issue Description

This is a regression introduced in version 2.3.3, it seems most likely due to #3389. If you define an Array column and you save an array of Date objects to it (see Swift code below), it will actually save it as an array of Strings. With version 2.3.2, they were properly saved as Date objects.

Steps to reproduce

  1. Add an Array column to your user schema
  2. Save an array of dates to that field - example in Swift:
guard let user = PFUser.current() else { return }
user["dates"] = [Date()]
user.saveEventually()

Expected Results

The dates field should contain a single Date object

Actual Outcome

The dates field contains a single String object

Environment Setup

  • Server

    • parse-server version: Any version after 2.3.2, specifically tested 2.3.6
    • Operating System: not sure
    • Hardware: not sure
    • Localhost or remote server? Remote on Heroku
  • Database

    • MongoDB version: 3.2.11 (MMAPv1)
    • Storage engine: not sure
    • Hardware: not sure
    • Localhost or remote server? Remote on mLab

Logs/Trace

Not relevant

@flovilmart
Copy link
Contributor

Thanks for the detailed issue report, we'll have a look shortly

@hipwelljo
Copy link
Author

Hold up, seems I'm incorrect, I'm seeing the issue again now with 2.3.2. Investigating I'll provide more deets soon.

@flovilmart
Copy link
Contributor

all good! Take your time! Your issue seems to be well defined and we should be able to write a unit test for that.

@hipwelljo
Copy link
Author

Aw, this isn't an issue in Parse Server, it's an issue with Parse Dashboard. Double clicking in the array field to examine the dates and clicking outside to defocus seems to be saving the array and overriding it with strings instead of dates - likely simply because it shows them as strings and it saves on defocus. I can file a new report against parse dashboard.

@hipwelljo
Copy link
Author

Someone else already encountered this issue, reported here: https://github.com/ParsePlatform/parse-dashboard/issues/590

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

No branches or pull requests

2 participants