Skip to content

Remove globally pinned Parse instance #10077

@mtrezza

Description

@mtrezza

New Issue Checklist

Issue

Parse Server uses and provides a globally pinned Parse object for use in Cloud Code. This is a problematic design because the globally pinned instance may be initialized properly for use in Cloud Code (masterKey, appId, serverURL, etc.), but another module like the push adapter may use a different version of parse dependency, which prevents npm from deduplicating the dependency. Code that references that other version uses an uninitialized instance of Parse which causes the error: Cannot use the Master Key, it has not been provided..

Fix

Remove the global pinning and explicitly import Parse wherever needed. Also explicitly expose the initialized Parse instance via a Parse Server API, like Parse.Server or Parse.Cloud.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions