Commit Graph

463 Commits

Author SHA1 Message Date
David Greenspan
ff1ec8bc14 sendError typos 2012-03-06 15:45:24 -08:00
David Greenspan
25e82a2cff fix new timers API for IE (fixes tests) 2012-03-06 15:45:22 -08:00
Geoff Schmidt
3dc8dc2887 Permit fine-grained control of database polling.
You can now used invalidation keys to specify exactly what will get polled when.
2012-03-06 15:44:42 -08:00
Geoff Schmidt
14d41036f4 Simplify subscription API
- Use positional arguments
- Pass the subscription object in 'this'
2012-03-06 15:44:42 -08:00
Geoff Schmidt
d2baaedc9d rename DynamicVariable => EnvironmentVariable 2012-03-06 15:44:41 -08:00
Geoff Schmidt
dd6f013e9b generalize write fencing to support all databases 2012-03-06 15:44:41 -08:00
Geoff Schmidt
ab7c06bade Merge branch 'test-enhancements' 2012-03-02 05:25:12 -08:00
Geoff Schmidt
76c57526f7 rework public API for defining tests 2012-03-02 05:22:40 -08:00
Geoff Schmidt
7729b7d887 make private tinytest symbols private 2012-03-02 05:13:41 -08:00
Geoff Schmidt
0822bd410f rework public API for running tests 2012-03-02 05:08:06 -08:00
Geoff Schmidt
74dbbf3419 clean up test reporting plumbing 2012-03-02 04:43:03 -08:00
Geoff Schmidt
601f20553e Get rid of all global state in tests 2012-03-02 04:22:57 -08:00
Geoff Schmidt
cab5afbb91 move test reporting functions out of globals 2012-03-02 03:57:30 -08:00
Geoff Schmidt
c2302c9e46 factor dynamic variable fully into tinytest.js 2012-03-02 03:27:55 -08:00
Geoff Schmidt
a0877e26be move driver entrypoints from 'test' to 'tinytest' 2012-03-02 03:18:18 -08:00
Geoff Schmidt
bc69d57e16 Give each test run a unique ID 2012-03-02 02:32:32 -08:00
Geoff Schmidt
60913bfd6f Notify observers asynchronously, add write fencing 2012-03-02 01:41:06 -08:00
Geoff Schmidt
9a61fb3554 Merge branch 'delay-livedata-migration' 2012-03-01 19:42:17 -08:00
Geoff Schmidt
86951aa743 block migration until livedata methods finish
-- This way we don't have to worry about losing the lambdas that go with outstanding method invocations.

Also, don't listen to reload signals except from App (not from third-party DDP servers.)
2012-03-01 19:40:44 -08:00
Geoff Schmidt
224f48cc81 In a migration, always get a consistent snapshot 2012-03-01 19:37:05 -08:00
Geoff Schmidt
ddfbf236ce allow packages to block migration until they're ready 2012-03-01 17:25:36 -08:00
Geoff Schmidt
79aabd797b make apply() somewhat more idiomatic 2012-03-01 05:11:56 -08:00
Geoff Schmidt
562a1a1122 Merge branch 'livedata-reconnection' 2012-03-01 03:59:54 -08:00
Geoff Schmidt
e48f335e94 Make requests idempotent on a connection
Use a replay cache. When a request is replayed, replay the response. Prune the replay cache based on a timer, but only when the session is connected.
2012-03-01 03:56:10 -08:00
Geoff Schmidt
8fc57d02fb helper for manually testing session reconnection 2012-03-01 03:28:18 -08:00
Geoff Schmidt
3f51c557a5 Implement reconnection on the client. 2012-03-01 03:04:35 -08:00
Geoff Schmidt
1353d48c72 Implement reconnection on the server. 2012-03-01 02:37:01 -08:00
Geoff Schmidt
363fb71443 allow session to exist without a socket 2012-03-01 02:37:01 -08:00
Geoff Schmidt
671b1833a8 route all message sending through session 2012-03-01 02:37:01 -08:00
Geoff Schmidt
a87c077f22 serialize all messages from each client 2012-03-01 02:37:01 -08:00
Geoff Schmidt
605838fbfa minor refactor 2012-03-01 02:37:01 -08:00
Geoff Schmidt
c8b5052add move message dispatch fully into LivedataSession 2012-03-01 02:37:01 -08:00
Geoff Schmidt
5bfc4c472b Don't create session until connect is received 2012-03-01 02:37:01 -08:00
Geoff Schmidt
071e055e7c refactor more methods onto LivedataSession 2012-03-01 02:37:01 -08:00
Geoff Schmidt
d8b01cb7fb cosmetic: match style on LivedataSubscription 2012-03-01 02:37:00 -08:00
Geoff Schmidt
ff9eaea2b8 refactor methods on to LivedataSession 2012-03-01 02:37:00 -08:00
Geoff Schmidt
e85226f21f refactor: stream errors; sessions off of sockets 2012-03-01 02:37:00 -08:00
Geoff Schmidt
68345e7c06 factor out ClientInvocation
on reconnect, send methods in order
2012-02-29 23:38:12 -08:00
matt debergalis
26d75bef7e Merge branch 'new-subs' 2012-02-29 16:11:31 -08:00
matt debergalis
55c9a27d94 bump timeout to 5 sec 2012-02-29 16:09:00 -08:00
matt debergalis
d5fd6e8738 Update documentation. 2012-02-29 16:08:59 -08:00
matt debergalis
3f1ff26e43 Convert to new publish API. 2012-02-29 16:08:59 -08:00
matt debergalis
8a8e402510 autopublish in leaderboard 2012-02-29 16:08:59 -08:00
matt debergalis
c0b3df5a91 Sync Minimongo observe API to server.
Return old document in callbacks.  Add LiveResultsSet.collection to
match server.

Add observe() unit test suite.
2012-02-29 16:08:58 -08:00
matt debergalis
b35af422c6 Support field selection in server-side mongo.
Can now publish subsets of documents with something like this:

Meteor.publish('items', function (sub, params) {
  return Items.find({user_id: params.user_id},
                    {fields: {some_secret_field: 0}});
});

where items.some_secret_fields won't be included in the publish output.

(fields option is ignored by minimongo.)
2012-02-29 16:08:58 -08:00
matt debergalis
cb887f5a9b Rework livedata (DDP) subscriptions.
Publish now comes in three flavors:

* Bare metal API: Meteor.publish(name, func).

  Server will call func(sub, params) each time a client subscribes to
  "name" (with supplied "params"), or if "name" is null, each time a new
  client connects (autopublish).  "sub" is a Subscription object, which
  supplies sub.set(), sub.unset(), sub.satisfies(), and sub.flush()
  methods to emit DDP data messages.  func() should register a cleanup
  function with sub.onStop(), which will be called when client unsubs.

  To react to database changes, use Collection.observe().  Publish
  functions that are not database backed may use some other mechanism
  (setInterval?) to schedule calls to sub.set().

* publishCursor API:

  If func() *returns* a Cursor, server will automatically publish all
  results from that cursor as the collection with the same name as the
  cursor's underlying Mongo collection.  For example:

  Meteor.publish('top10', function (sub, params) {
    return Players.find({}, {sort: {score: -1}, limit: 10});
  });

  will define a 'top10' publish that is always the top 10 scoring
  players, published to the 'players' collection on each subscribing
  client.

* autopublish

  When the autopublish package is loaded, all Collections defined on the
  server will automatically be published, in their entirety, to each
  connected client.  Clients need not call Meteor.subscribe().  Calls to
  publish() will emit a warning message, since they are superflous.  To
  disable autopublish, run "meteor remove autopublish".
2012-02-29 16:08:58 -08:00
David Greenspan
5aeff801c3 deepcopy consistently in minimongo callbacks (to not mask bugs) 2012-02-29 13:16:16 -08:00
Geoff Schmidt
980868bc1b Merge branch 'methods' 2012-02-29 04:38:40 -08:00
Geoff Schmidt
5cf9351ecd Test compound methods, including clients cheating 2012-02-29 04:36:51 -08:00
Geoff Schmidt
72e37d8748 Method invocation tests pass on server
(as well as client)
2012-02-29 02:04:33 -08:00