Skip to content
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

Mostly only cordova #7

Closed
lorensr opened this issue May 12, 2016 · 5 comments
Closed

Mostly only cordova #7

lorensr opened this issue May 12, 2016 · 5 comments
Labels
Milestone

Comments

@lorensr
Copy link
Collaborator

lorensr commented May 12, 2016

My refactor broke web reloading :) We can use this method of making the api callable from outside cordova:

https://github.com/meteor/mobile-packages/blob/master/packages/mdg:reload-on-resume/browser.js
https://github.com/meteor/mobile-packages/blob/master/packages/mdg:reload-on-resume/package.js

@lorensr lorensr added the bug label May 12, 2016
@lorensr lorensr added this to the v2 milestone May 12, 2016
@lorensr
Copy link
Collaborator Author

lorensr commented May 17, 2016

@lorensr
Copy link
Collaborator Author

lorensr commented May 19, 2016

Actually, that's probably due to us not returning an array from _onMigrate. Compare to reload-on-resume

image

@gbhatnag
Copy link

Looking at the original definition of Reload._onMigrate (at ~/.meteor/packages/reload/1.1.4/web.browser/packages/reload.js), there are docs that preface the method and the role of the retry function. Here's the full text --

// Packages that support migration should register themselves by calling                   // 104
// this function. When it's time to migrate, callback will be called                       // 105
// with one argument, the "retry function," and an optional 'option'                       // 106
// argument (containing a key 'immediateMigration'). If the package                        // 107
// is ready to migrate, it should return [true, data], where data is                       // 108
// its migration data, an arbitrary JSON value (or [true] if it has                        // 109
// no migration data this time). If the package needs more time                            // 110
// before it is ready to migrate, it should return false. Then, once                       // 111
// it is ready to migrating again, it should call the retry                                // 112
// function. The retry function will return immediately, but will                          // 113
// schedule the migration to be retried, meaning that every package                        // 114
// will be polled once again for its migration data. If they are all                       // 115
// ready this time, then the migration will happen. name must be set if there              // 116
// is migration data. If 'immediateMigration' is set in the options                        // 117
// argument, then it doesn't matter whether the package is ready to                        // 118
// migrate or not; the reload will happen immediately without waiting                      // 119
// (used for OAuth redirect login).                                                        // 120
//                                                                                         // 121
Reload._onMigrate = function (name, callback) {                                            // 122
  if (!callback) {                                                                         // 123
    // name not provided, so first arg is callback.                                        // 124
    callback = name;                                                                       // 125
    name = undefined;                                                                      // 126
  }                                                                                        // 127
  providers.push({name: name, callback: callback});                                        // 128
};                                                                                         // 129

(the full code is available here: https://github.com/meteor/meteor/blob/devel/packages/reload/reload.js)

Is there some reason we're not using the retry function?

@lorensr
Copy link
Collaborator Author

lorensr commented Sep 1, 2016

Probably just we didn't know about it :) Looks like it's something we should use

@lorensr
Copy link
Collaborator Author

lorensr commented Sep 1, 2016

Thanks 😄

@lorensr lorensr closed this as completed in 3630bab Sep 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants