90 Commits

Author SHA1 Message Date
Naomi Seyfer
9f22ca14fd Merge branch 'devel' into ddp-pre1 2013-02-14 18:31:10 -08:00
Nick Martin
8896281b05 Merge remote-tracking branch 'remotes/origin/pr/679' into devel. Fixes #679. 2013-02-13 21:10:59 -08:00
David Glasser
e1b07e4848 Merge branch 'devel' into ddp-pre1 2013-02-13 17:05:07 -08:00
David Glasser
562eb0a54a Fix use of wrong field name in hot code push check.
Could result in multiple attempts to reload.
2013-02-13 10:28:49 -08:00
Andrew Wilcox
f2d9792f90 Route policy declarations (for network routes only for now).
Allows packages such as stream and accounts to declare URL prefixes
such as /sockjs/ and /_oauth/ to be network routes.

Updates server to avoid serving app HTML on network routes.

Checks for conflict between files in public/ and network routes.  For
example, the developer might not know that /sockjs/ is reserved, and
might create a file "public/sockjs/socks-are-great.png".
2013-02-13 13:12:59 +00:00
David Glasser
9b486b3c9b Meteor.random -> Random.fraction
add Random.choice
2013-02-13 00:08:50 -08:00
David Glasser
d2ae5f7e1c Replace almost all uses of Meteor.uuid with Random.id. 2013-02-12 23:55:19 -08:00
David Glasser
fdb1773d4a Rename uuid package to random. No further changes. 2013-02-12 23:38:22 -08:00
David Glasser
78b5ee5e7d When a stream is force-disconnected, don't restart its heartbeat timer.
Accomplish this in two ways:
  - Explicitly making sure not to restart the timer on disconnected streams.
  - Run the "restart heartbeat" code before processing incoming messages,
    not after, since even the "failed" message that caused a disconnect
    was running the "restart heartbeat" code.
2013-02-01 17:43:44 -08:00
Naomi Seyfer
e1aa360b98 Merge branch 'devel' into ddp-pre1
Now don't require _id to be unset on insert anymore.

Some error handling around duplicate _id

Conflicts:
	packages/minimongo/minimongo.js
	packages/mongo-livedata/collection.js
	packages/mongo-livedata/mongo_livedata_tests.js
2013-02-01 16:10:18 -08:00
Nick Martin
514bf73807 Move serverId to __meteor_runtime_config__. This prevents a race condition where the server restarts between when the client loads app.html and when it makes a DDP connection. Fixes #653. Thanks @awwx! 2013-02-01 12:21:08 -08:00
David Glasser
d7f07b318e Merge branch 'devel' into ddp-pre1 2013-01-30 11:10:23 -08:00
David Glasser
62e83ec2bc When a connection fails permanently due to version number skew, show it in the
reactive status object and don't try to reconnect.

Note that this only happens if the server rejects the connection due to an
unfixable version mismatch: if the server is unreachable or not speaking
versioned DDP, the client will continue to retry.
2013-01-29 22:36:13 -08:00
Avital Oliver
1fa2006eb7 Fix standalone tests for the 'stream' package 2013-01-28 13:39:47 -08:00
David Glasser
a709cfb4ec Version negotiation: feedback from review. 2013-01-17 15:25:01 -05:00
David Glasser
5e6bd79321 Followup to 7289950b: fix and add tests and comments.
7289950b removed the long-deprecated support for including "/sockjs" in
HTTP/HTTPS URLs passed to Meteor.connect (though it is require for the new
ddp+sockjs URLs), breaking some tests and making some comments incorrect. These
are now fixed.
2012-12-09 21:23:49 -08:00
David Glasser
7289950b54 Implement "ddp+sockjs://" and "ddpi+sockjs://" URLs for Meteor.connect.
This is not yet documented or fully supported (ie, it may change before 1.0).

ddp+sockjs:// URLs are translated into https:// URLs and explicitly contain the
"/sockjs" endpoint. Any '*' in the hostname should be changed into a random
digit before opening a SockJS connection, to help avoid browser per-hostname
connection limits.

ddpi+sockjs:// is identical but uses http:// instead.

The DEFAULT_DDP_ENDPOINT environment variable has been renamed
DDP_DEFAULT_CONNECTION_URL. (For now, 'meteor deploy' will continue to also
provide non-"ddp+sockjs://" URLs in the old environment variable so that old
apps continue to work).
2012-12-06 16:45:01 -08:00
Nick Martin
d1ce91d48e Update sockjs to 0.3.4. This removes the meteor patch from #339, but preserves the patch to do http->https on IE. 2012-11-15 20:44:57 -08:00
Avital Oliver
3e2de505b0 Don't drop method calls on the floor shortly after connectivity loss. Fixes #339 2012-11-14 16:29:01 -08:00
Avital Oliver
54b1411b72 Improve docs around internal patches to sockjs
Refer to the GitHub issue discussing a bug.
2012-11-14 14:31:02 -08:00
David Glasser
a5879bad8f Increase SockJS disconnect_delay to avoid mistakenly disconnecting users.
Part of issue #207.
2012-10-12 17:30:16 -07:00
David Glasser
3cf7dce666 Privatize the "force" option to Meteor.reconnect (added on the auth branch and
mostly used for manual testing).
2012-10-10 16:57:39 -07:00
David Glasser
41cc24d9e7 Merge branch 'devel' into auth
Pulls in Meteor._ContextSet, bumps version to 0.4.2, etc.
2012-10-06 11:10:56 -07:00
David Glasser
20e29d2851 Make everything in deps-utils private for now. 2012-10-05 15:26:22 -07:00
David Glasser
08a0eda83e Merge branch 'devel' into deps-utils-private
Conflicts:
	packages/session/session.js
2012-10-05 15:14:13 -07:00
David Glasser
be4da5fba4 Revert "Support unlimited tabs by working around browser per-hostname connection limits."
This reverts commit 2495cb2f58.

This change made it easy to construct URLs with more than 63 characters in a
label, which is not legal. We will redo this later with generating a smaller
random token (and taking other precautions to limit the total size of the
label).
2012-10-01 13:45:54 -07:00
David Glasser
2495cb2f58 Support unlimited tabs by working around browser per-hostname connection limits.
The URL provided to Meteor.connect may now be a function returning a new URL on
each socket connection, or contain the substring "MeteorWildcard" which is
replaced by a random string (a UUID) on each socket connection.
2012-09-28 11:57:48 -07:00
David Glasser
5470b3f511 Merge branch 'devel' into auth 2012-09-27 13:51:21 -07:00
David Glasser
a016e83754 Let exceptions from stream message callbacks percolate upwards.
We used to be unable to do this because of a SockJS bug, but the SockJS folks
read our XXX comment and fixed the bug!
https://github.com/sockjs/sockjs-client/issues/61
2012-09-25 18:26:06 -07:00
David Greenspan
301b03b7d5 Merge branch 'devel' into deps-utils 2012-09-17 18:02:22 -07:00
David Glasser
2fedd2adfc Merge branch 'devel' into auth
Conflicts:
	packages/livedata/livedata_common.js
	packages/livedata/livedata_connection.js
	packages/livedata/livedata_server.js
	packages/mongo-livedata/collection.js
2012-09-17 14:42:10 -07:00
David Glasser
5e622215ba Change all publicly documented APIs to use camelCase.
For now, the old names still work as well.

This includes:
  - Meteor.isServer/isClient
  - this.isSimulation in methods
  - Context.onInvalidate
  - Meteor.status().retryCount/retryTime

Remove old backwards-compatibility "Sky" alias for "Meteor".

Update all examples in the docs to use camelCase.

Delete unused docs/client/projects.html file.
2012-09-17 14:26:45 -07:00
David Greenspan
3094db17ff replace connection status logic with three LoCs 2012-09-16 02:48:23 -07:00
Nick Martin
4417dad584 Add option to force reconnect when already connected. 2012-07-23 17:57:12 -07:00
Nick Martin
f5317b3823 Remove broken code. This only reason this didn't cause breakages is we never set up events after being connected. 2012-07-23 17:57:12 -07:00
Nick Martin
26136a22a4 Fallback to jsonp-polling in IE when going cross scheme.
https://github.com/sockjs/sockjs-client/issues/79
2012-07-11 21:19:15 -07:00
Nick Martin
6049771204 Also clear heartbeat timer when we get data messages.
This fixes an issue with spurious connection closing.
2012-06-13 20:12:08 -07:00
Nick Martin
a1a6414c1a Add heartbeat timer so we notice when the server silently goes away. 2012-05-22 21:32:15 -07:00
Avital Oliver
4f3d8151b6 Add /websocket endpoint. 2012-05-09 23:55:02 -07:00
Avital Oliver
944e2437f6 Refactor the conversion to a sockjs url
Instead of having it be in LivedataConnection, put it in
Stream. This means that LivedataConnection doesn't need to
know anything about sockjs (though for now it does since
we still support the old deprecated API)
2012-05-03 19:42:38 -07:00
Avital Oliver
fd01cf84e0 Hide sockjs URL endpoint from user of Meteor.connect
OLD: Meteor.connect("http://subdomain.meteor.com/sockjs")
NEW: Meteor.connect("subdomain.meteor.com")

While at it, updated any references I could find to explicit sockjs URLs
2012-05-02 21:17:33 -07:00
Nick Martin
54f6f01e48 Update sockjs client to 0.3.1. 2012-04-25 17:20:43 -07:00
Nick Martin
f00a8a21fb Allow native websockets connections to sockjs.
This interface will probably change, but enabling this allows people to get started on non-browser DDP clients now.
2012-04-23 19:49:53 -07:00
Nick Martin
3f3e014071 Allow setting SERVER_ID via environment variable. 2012-04-13 17:27:45 -07:00
Nick Martin
d56725dd6a Move stub_stream to test helpers. 2012-04-03 22:37:12 -07:00
Nick Martin
550fabf052 Stub stream based tests for livedata connection. 2012-04-03 22:37:12 -07:00
Nick Martin
df8460130f Only use polling, not streaming or websockets.
This improves cross-browser compatibility, and shouldn't hurt too much. We may want to revisit this later.
2012-03-07 18:18:30 -08:00
Geoff Schmidt
76c57526f7 rework public API for defining tests 2012-03-02 05:22:40 -08:00
Geoff Schmidt
cab5afbb91 move test reporting functions out of globals 2012-03-02 03:57:30 -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