[ews] Eliminate required boilerplate for EWS client operations
Categories
(MailNews Core :: Networking: Exchange, task)
Tracking
(Not tracked)
People
(Reporter: edicharry, Assigned: jtracey)
References
Details
(Keywords: leave-open)
Attachments
(16 files, 1 obsolete file)
13.71 KB,
patch
|
Details | Diff | Splinter Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Currently, all of our EWS operations have the following structure:
impl XpComEwsClient {
fn some_operation(...) {
match self.some_operation_inner(...).await {
Ok(some_data) => //operation success callback,
Err(err) => //operation failure callback,
}
}
fn some_operation_inner(...) -> Result<SomeData, XpComEwsError> {
// construct input, call self.make_operation_request, parse response
}
}
The structure is there to allow the implementation to propagate errors, but the outer function is almost exactly the same for all of the client operations, so we want to eliminate the boiler plate and have a uniform way of doing this.
I'm attaching a partial patch of some work I did as part of another issue that we decided to hold off on in order come up with a more uniform approach for this.
Assignee | ||
Comment 1•2 months ago
|
||
Assignee | ||
Comment 2•16 days ago
|
||
Assignee | ||
Comment 3•16 days ago
|
||
The new trait is demonstrated with XpComEwsClient::check_connectivity
.
Assignee | ||
Comment 4•15 days ago
|
||
Assignee | ||
Comment 5•15 days ago
|
||
Assignee | ||
Comment 6•15 days ago
|
||
Assignee | ||
Comment 7•15 days ago
|
||
Assignee | ||
Comment 8•15 days ago
|
||
Assignee | ||
Comment 9•15 days ago
|
||
Assignee | ||
Comment 10•15 days ago
|
||
Assignee | ||
Comment 11•15 days ago
|
||
Assignee | ||
Comment 12•15 days ago
|
||
Assignee | ||
Comment 13•15 days ago
|
||
Assignee | ||
Comment 14•15 days ago
|
||
Assignee | ||
Comment 15•15 days ago
|
||
Try run for https://phabricator.services.mozilla.com/D266205 only (failures are unrelated): https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=acfec97e5a7ee61fdbda60a0f893db254b633243
Updated•15 days ago
|
Assignee | ||
Comment 16•15 days ago
|
||
Comment 17•15 days ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/152dfd0cefbc
Use operation name constants instead of magic strings. r=edicharry
Assignee | ||
Updated•11 days ago
|
Updated•11 days ago
|
Comment 18•11 days ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/4613f65ed3f0
Add DoOperation trait to represent doing EWS operations. r=edicharry
Comment 19•11 days ago
•
|
||
(In reply to Pulsebot from comment #18)
This is breaking the builds - https://treeherder.mozilla.org/jobs?repo=comm-central&revision=4613f65ed3f0a68caf6f4ad4d18bce0ba765b924. Will back out
Comment 20•11 days ago
|
||
Assignee | ||
Comment 21•10 days ago
|
||
Whoops, didn't properly test the individual patches after rebasing, sorry. New try run for just the one patch: https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=bc4e042c4ba99852f351701e40618c3ea3d15dc5
Comment 22•10 days ago
|
||
Pushed by vineet@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/b7ed54290558
Add DoOperation trait to represent doing EWS operations. r=edicharry
Assignee | ||
Comment 23•8 days ago
|
||
Try run for the whole patch set: https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=307f967cbc3da39f229c02ac2b3e14b243f92654
Assignee | ||
Updated•8 days ago
|
Assignee | ||
Comment 24•8 days ago
|
||
Comment 25•8 days ago
|
||
Pushed by edicharry@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/7dd560b32fe1
Implement DoOperation for CreateFolder. r=edicharry
https://hg.mozilla.org/comm-central/rev/a243076046cf
Implement DoOperation for copy/move operations. r=edicharry
https://hg.mozilla.org/comm-central/rev/cff0d8f078f3
Implement DoOperation for MarkAsJunk. r=edicharry
https://hg.mozilla.org/comm-central/rev/4094ebeab7d0
Implement DoOperation for SyncFolderHierarchy. r=edicharry
https://hg.mozilla.org/comm-central/rev/a9b5793e18d7
Implement DoOperation for sync_messages_for_folder. r=edicharry
https://hg.mozilla.org/comm-central/rev/26550588c2d3
Implement DoOperation for GetMessage. r=edicharry
https://hg.mozilla.org/comm-central/rev/9faae0b6e51b
Implement DoOperation for SendMessage. r=edicharry
https://hg.mozilla.org/comm-central/rev/f226b3d7daa5
Implement DoOperation for create_message. r=edicharry
https://hg.mozilla.org/comm-central/rev/8407475896ee
Implement DoOperation for delete_messages. r=edicharry
https://hg.mozilla.org/comm-central/rev/fe0803ad0e93
Implement DoOperation for DeleteFolder. r=edicharry
https://hg.mozilla.org/comm-central/rev/1cb3aaa42454
Implement DoOperation for UpdateFolder. r=edicharry
Assignee | ||
Updated•2 days ago
|
Comment 26•2 days ago
|
||
Pushed by vineet@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/f607e3556a50
Implement DoOperation for change_read_status. r=babolivier
Description
•