canmove, Confirmed users
725
edits
(Created page with "= Getting rid of Sync.js = == Current situation<br> == <br> *Resource._request()<br> *Utils.queryAsync()<br> *(possibly) threaded crypto<br> <br> == Problem<br> == <br> =...") |
No edit summary |
||
| Line 15: | Line 15: | ||
<br> | <br> | ||
== Proposed solution<br> == | == Proposed solution<br> == | ||
<br> | <br> | ||
{| cellspacing="1" cellpadding="1" border="1" | {| cellspacing="1" cellpadding="1" border="1" | ||
|- | |- | ||
! scope="col" | API Method<br> | ! scope="col" | API Method<br> | ||
! scope="col" | Risk<br> | ! scope="col" | Risk<br> | ||
! scope="col" | Explanation<br> | ! scope="col" | Explanation<br> | ||
|- | |- | ||
| Resource.*<br> | | Resource.*<br> | ||
| <br> | | high<br> | ||
| <br> | | Used all over the place, causes many of the following to be async.<br> | ||
|- | |- | ||
| Records.get()<br> | | | ||
| <br> | Records.import() | ||
| | |||
Records.get() | |||
| low<br> | |||
| Uses Resource.get(). Only used in SyncEngine.sync() and Service.sync() which need to be made async anyway.<br> | |||
|- | |||
| PubKeys.uploadKeypair() | |||
| low | |||
| Uses Resource.put(). Only used in Service._remoteSetup() which needs to be made async anyway. | |||
|- | |||
| SyncEngine.sync() | |||
| low | |||
| Only used from | |||
|- | |||
| SyncEngine.wipeServer() | |||
| low | |||
| Only used from SyncEngine.sync() and | |||
|} | |} | ||
<br> | |||
<br> | |||
<br> | |||
Records.get() (may call Records.import() which calls Resource.get())<br> | |||
PubKeys.uploadKeypair()<br> | |||
SyncEngine. | SyncEngine.sync() (defers to ~three methods internally which do all the work)<br> | ||
SyncEngine.wipeServer()<br> | |||
Service. | Service.login()<br> | ||
Service. | Service.verifyLogin()<br> | ||
Service. | Service.changePassword()<br> | ||
Service. | Service.checkUsername() / checkAccount()<br> | ||
Service. | Service.createAccount()<br> | ||
Service. | Service._scheduleNextSync()<br> | ||
Service. | Service.sync (and various methods that it defers to internally)<br> | ||
Service. | Service.wipeServer(), Service.wipeRemote() | ||
Service.getQuota<br> | Service.getCollectionUsage, Service.getQuota<br> | ||
<br> | <br> | ||
*"weave:resource:status:401" observer notification<br> | *"weave:resource:status:401" observer notification<br> | ||
<br> | <br> | ||
#Everything takes a callback<br> | #Everything takes a callback<br> | ||
<br> | <br> | ||