Skip to content

Convert Date to ISO string in functions #4887

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

Merged
merged 1 commit into from
May 27, 2021
Merged

Convert Date to ISO string in functions #4887

merged 1 commit into from
May 27, 2021

Conversation

hsubox76
Copy link
Contributor

Fixes #683
Also see #4450

Currently httpsCallable functions serialize any Date objects passed to them to an empty object ({}). In the absence of a comprehensive Date type shared across all the SDK client platforms plus the functions backend, which may or may not happen, we should at least convert it to an ISO string.

We are not automatically deserializing ISO strings because the developer may intentionally be passing that string down from the cloud function.

@changeset-bot
Copy link

changeset-bot bot commented May 10, 2021

🦋 Changeset detected

Latest commit: d0485bd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/functions Patch
firebase Patch
@firebase/rules-unit-testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

Changeset File Check ⚠️

  • Warning: This PR modifies files in the following packages but they have not been included in the changeset file:

    • @firebase/functions-exp

    Make sure this was intentional.

@Feiyang1 Feiyang1 self-assigned this May 24, 2021
@Feiyang1 Feiyang1 assigned hsubox76 and unassigned Feiyang1 May 26, 2021
@hsubox76 hsubox76 merged commit 92e4e8d into master May 27, 2021
@hsubox76 hsubox76 deleted the ch-function-date branch May 27, 2021 20:48
@google-oss-bot google-oss-bot mentioned this pull request Jun 2, 2021
@firebase firebase locked and limited conversation to collaborators Jun 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date handling in functions serializer
2 participants