Commit Graph

43 Commits

Author SHA1 Message Date
marvelm
8a23c00265 Add support for expiration interval in Push (#4202)
* Add support for expiration_interval in Push

* Support expiration_interval for immediate pushes

* Test

* Add 'expiration_interval' to _PushStatus class

* Fix coverage
2017-10-25 17:30:20 -04:00
Florent Vilmart
9de4b8b2a7 Refactors configuration management (#4271)
* Adds flow types / Configuration interfaces

* Lets call it options

* Use a single interface to generate the configurations

* Translates options to definitions only if comments are set

* improves logic

* Moves objects around

* Fixes issue affecting logging of circular objects

* fixes undefined env

* Moves all defaults to defaults

* Adds back CLI defaults

* Restored defaults in commander.js

* Merge provided defaults and platform defaults

* Addresses visual nits

* Improves Config.js code

* Adds ability to pass the default value in trailing comments

* Load platform defaults from the definitions file

* proper default values on various options

* Adds ParseServer.start and server.start(options) as quick startup methods

* Moves creating liveQueryServer http into ParseServer.js

* removes dead code

* Adds tests to guarantee we can start a LQ Server from main module

* Fixes incorrect code regading liveQuery init port

* Start a http server for LQ if port is specified

* ensure we dont fail if config.port is not set

* Specify port

* ignore other path skipped in tests

* Adds test for custom middleware setting

* Refactors new Config into Config.get

- Hides AppCache from ParseServer.js, use Config.put which validates

* Extracts controller creation into Controllers/index.js

- This makes the ParseServer init way simpler

* Move serverURL inference into ParseServer

* review nits
2017-10-23 08:43:05 -04:00
Florent Vilmart
b703ec8a79 Fix for #4194 - me no likey much (#4198)
* Adds failing test for #4194

* Use the rest module instad of the Parse._request

- Some users have an invalid serverUrl passed in the options

* removes console.logs, fixes tests that leveraged Parse._request
2017-09-22 12:05:06 -04:00
Florent Vilmart
a5ce9fc175 Refactor pushStatusHandler to use Parse instead of direct access (#4173)
* Refactors pushStatusHandler to use HTTP interface so we can bind CloudCode hooks

* Handle correctly nested dot atomic operations

* Better handling of restricted class names, add support for afterSave _PushStatus

* Adds simple testing for afterSave(PushStatus)

* Reverts jobStatusHandler

* Addresses fixes

* adds delays to all methods
2017-09-18 15:01:07 -04:00
Anthony Mosca
4dce3bd63c Add support for more audience fields. (#4145)
* Add support for more audience fields.

* Only update audience when defined audience_id.
2017-09-11 22:06:21 -04:00
marvelm
bc3cef2cd9 Support local time for scheduled pushes (#4137)
* Handle local push time

* PR feedback

* Improve timezone detection with regex

* Use indexOf instead of endsWith

* Add documentation

* Add end to end test for scheduled pushes in local time

* Revert changes to npm-git script

* clean up
2017-09-11 09:31:46 -04:00
Florent Vilmart
6df944704c Adds support for localized push notification in push payload (#4129)
* Adds support for localized push data keys

- passign alert-[lang|locale] or title-[lang|locale] will inject the
  proper locale on the push body based on the installation

* Better handling of the default cases

* Updates changelog

* nits

* nits
2017-09-01 15:22:02 -04:00
Florent Vilmart
ea67d23ef4 Improvements for sending push performance (#4122)
* Adds test for stalled pushStatus when audience is empty

* fixup! Adds test for stalled pushStatus when audience is empty

* Do not enqueue when count is 0, enforce deviceToken exists, stop badge ordering
2017-08-29 11:47:01 -04:00
Florent Vilmart
ad52ed64af Lets increment/set badges on all _Installations (#3970)
* Lets increment/set badges on all _Installations

* Makes sure PG update where query is properly formed with empty query
2017-07-03 10:16:04 -04:00
greenkeeper[bot]
e94991b368 Update dependencies to enable Greenkeeper 🌴 (#3940)
* chore(package): update dependencies

* docs(readme): add Greenkeeper badge

* Fix indent issues with eslint 4.0

see http://eslint.org/docs/user-guide/migrating-to-4.0.0\#-the-indent-rule-is-more-strict
2017-06-20 09:15:26 -07:00
Worathiti Manosroi
7d70af60ba fix: volatileClasses are masterKey only (#3916)
* volatileClass should respect the schema if defined

* masterKey only for the volatileClasses

* add some test …
2017-06-13 10:36:40 -04:00
Anthony Mosca
1f11ad5d74 chore(PushController): Fix push controller tests. (#3853) 2017-05-23 20:22:35 -04:00
Felipe Andrade
03b6449fe1 [PushController] Fixes issue with undefined push_time (#3717) (#3824)
* Fixes #3717

This fixes PR #3717. Sending push with parse-server@2.4.0 returns error
504 GATEWAY_TIMEOUT. This happens when push_time is not set (default).

* Fix lint issues

* Fix in PushController and add tests

Add a test to check push_time format and if it should schedule push
when the parse-server is configured
2017-05-20 12:07:45 -04:00
Florent Vilmart
88de01f3d8 Fix issue _PushStatus stuck sending (#3808)
* Adds test for not set device tokens

* Properly filter the installations without a deviceToken

* nit for slower PG test

* nit
2017-05-12 14:24:37 -04:00
Florent Vilmart
907b160fc7 Adds support for PushScheduling (#3722)
* Add support for push scheduling

Add a configuration flag on the server to handle the availability of
push scheduling.

* Update push controller to skip sending only if scheduling is configured

Only skip push sending if scheduling is configured

* Update bad conventions

* Add CLI definitions for push scheduling

* Adds tests for pushTime

* Adds test for scheduling

* nits

* Test for not scheduled
2017-04-15 17:20:55 -04:00
jeacott1
82e0a59139 missing return in test. (#3645) 2017-03-15 08:59:19 -04:00
Florent Vilmart
deedf7b370 Push scalability (#3080)
* Update status through increment
* adds support for incrementing nested keys
* fix issue when having spaces in keys for ordering
* Refactors PushController to use worker
* Adds tests for custom push queue config
* Makes PushController adapter independant
* Better logging of _PushStatus in VERBOSE
2017-01-13 19:34:04 -05:00
Arthur Cinader
4cb6e7d209 Add lint rule space-infix-ops (#3237)
Disallows: 1+1.  Must be 1 + 1.
2017-01-11 12:31:40 -08:00
Arthur Cinader
ca286b7108 Enable prefer-const lint rule (#3202) 2016-12-07 18:17:05 -05:00
Florent Vilmart
6676c6a4b9 Let multiple installations be updates if no critical values are set (#3040)
* Let multiple installations be updates if no critical values are set

* nits
2016-11-28 13:11:54 -05:00
Florent Vilmart
8c2c76dd26 Adds liniting into the workflow (#3082)
* initial linting of src

* fix indent to 2 spaces

* Removes unnecessary rules

* ignore spec folder for now

* Spec linting

* Fix spec indent

* nits

* nits

* no no-empty rule
2016-11-24 15:47:41 -05:00
Florent Vilmart
10ace495d8 Adds jobs endpoint protected by masterKey (#2560)
* Adds jobs endpoint protected by masterKey

* Adds connection timeout for 15 minutes in jobs

* Refactors pushStatusHandler into StatusHandler

* Adds reporting of _JobStatus

* Only accept strings as messages

* Adds test for masterKey basic auth

* Adds CloudCodeRouter for cloud_code endpoint of job status, enable Jobs feature on dashboard

* xit racing test
2016-08-30 07:19:21 -04:00
Florent Vilmart
9ab488b6a0 Postgres: $all, $and CLP and more (#2551)
* Adds passing tests

* Better containsAll implementation

* Full Geopoint support, fix inverted lat/lng

* Adds support for $and operator / PointerPermissions specs

* Fix issue updating CLPs on schema

* Extends query support

* Adds RestCreate to the specs

* Adds User specs

* Adds error handlers for failing tests

* nits

* Proper JSON update of AuthData

* fix for #1259 with PG

* Fix for Installations _PushStatus test

* Adds support for GlobalConfig

* Enables relations tests

* Exclude spec as legacy

* Makes corner case for 1 in GlobalConfig
2016-08-20 16:07:48 -04:00
Florent Vilmart
c0249283ac Advancements with postgres (#2510)
* Start DB runner from tests

* Connect GridstoreAdapter only when needed

* removes unused package

* better test errors reporting

* Adds support for __op.Delete

* Better test error reporting

* Makes sure all tests can run without crashing

* Use xdescribe to skip test suite

* Removes unused dependencies

* Let volatiles classes be created with PG on start

* Do not fail if class dont exist

* adds index.spec.js to the pg suite

* Use a new config each test to prevent side effects

* Enable EmailVerificationToken specs with pg

* Makes sure failure output is not cut

* Reduces number of ignored tests in ParseObject.spec

* Inspect reconfiguration errors

* Mark GlobalConfig is incompatible with PG

- Problem is with nested updates (param.prop = value)

* PG: Nested JSON queries and updates

- Adds support for nested json and . operator queries
- Adds debug support for PG adapter
- Adds loglevel support in helper

* Enable working specs in ParseUser

* Sets default logLevel in tests to undefined

* Adds File type support, retores purchaseValidation specs

* Adds support for updating jsonb objects

- Restores PushController tests

* Proper implementation of deleteByQuery and ORs

- Adds ParseInstallation spec to the test suite

* xit only failing tests

* Nit on ParseAPI spec

* add sorting operator

* properly bound order keys

* reverts describe_only_db behavior

* Enables passing tests

* Adds basic support for relations, upsertOneObject aliased to createObject

* progress on queries options

* Fix ACL update related problems

* Creates relation tables on class creation

* Adds Relation tests

* remove flaky tests

* use promises instead of CB

* disable flaky test

* nits

* Fixes on schema spec

- Next thing is to implemenet geopoint and files correctly

* fix failues

* Basic GeoPoint support

* Adds support for $nearSphere/$maxDistance geopoint queries

* enable passing tests

* drop tables afterEach for PG, clean up relation tables too

* Better initialization/dropTables
2016-08-15 16:48:39 -04:00
Antoine Lenoir
452887bd05 Change pushHash with stringified data (#2397)
* Change pushHash with stringify data

* stringify data.alert for pushHash

* stringify data.alert if object for pushHash

* test push notification when data.alert is an object
2016-08-09 12:00:56 -04:00
Drew
ab06055369 Postgres exclude failing tests (#2081)
* reload the right data

More passing postgres tests

Handle schema updates, and $in for non array columns

remove authdata from user and implement ensureUniqueness

Make some tests work, detect existing classes

Throw proper error for unique index violation

fix findOneAndUpdate

Support more types

support more type

Support boolean, fix _rperm/_wperm, add TODO

Support string types and also simplify tests

Move operator flattening into Parse Server and out of mongo adapters

Move authdata transform for create into Parse Server

Move authdata transforms completely in to Parse Server

Fix test setup

inline addSchema

Inject default schema to response from DB adapter

* Mark tests that don't work in Postgres

* Exclude one more test

* Exclude some more failing tests

* Exclude more tests
2016-06-17 12:59:16 -04:00
Marco Cheung
7c8ad7e071 Throw error when push is missing configuration (#2035) 2016-06-13 09:26:02 -07:00
Florent Vilmart
d49d539a81 _PushStatus uses proper Parse format (#1580)
* removes mongo style props from _PushStatus

* removes log

* Update MongoTransform.js

Removes _id case
2016-04-21 21:36:15 -04:00
Florent Vilmart
1023baf20d DBController refactoring (#1228)
* Moves transform to MongoTransform

- Adds ACL query injection in MongoTransform

* Removes adaptiveCollection from DatabaseController

- All collections manipulations are now handled by a DBController
- Adds optional flags to configure an unsafe databaseController for direct
  access
- Adds ability to configure RestWrite with multiple writes
- Moves some transfirmations to MongoTransform as they output specific code

* Renames Unsafe to WithoutValidation
2016-04-14 19:24:56 -04:00
Florent Vilmart
af30f669cc Push status nits (#1462)
* Sets _id to objectId in _PushStatus (fixes #1457)

* _PushStatus stores serialized payload (fixes #1458)
2016-04-12 17:43:46 -04:00
Florent Vilmart
6055f2a552 Improves report for Push error in logs and _PushStatus 2016-03-29 22:42:37 -04:00
Florent Vilmart
aeda714b87 Improve flattening of results from pushAdapter 2016-03-26 11:02:26 -04:00
Florent Vilmart
18781f1f82 Removes _PushStatus from system classes, uses direct DB access to write 2016-03-14 10:20:24 -04:00
Florent Vilmart
7c387e1ee9 Adds support to store push results 2016-03-13 23:37:13 -04:00
Florent Vilmart
dad50d12f5 Upgrade APNS to use HTTP/2
- uses universal certificate
- removes tests logs
- standardized returned promises from APNS and GCM to something usable in _PushStatus
2016-03-13 18:15:15 -04:00
Florent Vilmart
a392c088d8 Uses the resolved promise from the adapter 2016-03-12 15:30:12 -05:00
Florent Vilmart
4d401d9daa Stores the _PushStatus when sending push, set pending, and running states 2016-03-12 14:32:39 -05:00
Florent Vilmart
b89619b6ee Full query support for badge Increment 2016-03-11 16:23:58 -05:00
Florent Vilmart
bf96f0d28a Fixes problems related to increment badge
- name conventions are aweful in PushController
- properly looks at the badge into body.data instead of body
- We may want to refactor that as it's confusing to use a full body
2016-03-07 22:07:15 -05:00
Nikita Lutsenko
de0f71cc9e Remove useless masterKey validation in PushController.sendPush. 2016-03-07 17:22:27 -08:00
Florent Vilmart
ee3b37d4a2 Adds support for badging on iOS 2016-03-02 20:51:26 -05:00
Florent Vilmart
b490688652 Splits Push handling in Router and Controller
- Improves tests and coverage, fix bugs
2016-02-20 10:51:56 -05:00
wangmengyan95
06b1ee2362 Make push follow controller and adapter style 2016-02-11 02:56:52 -08:00