[PR #125] [MERGED] Refactor Adapters #1472

Closed
opened 2026-02-25 22:40:20 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/floccusaddon/floccus/pull/125
Author: @marcelklehr
Created: 6/8/2018
Status: Merged
Merged: 6/22/2018
Merged by: @marcelklehr

Base: developHead: refactor/adapters


📝 Commits (10+)

📊 Changes

21 files changed (+1820 additions, -939 deletions)

View changed files

📝 gulpfile.js (+62 -42)
📝 package.json (+1 -0)
📝 src/lib/Account.js (+53 -194)
📝 src/lib/AccountStorage.js (+40 -53)
📝 src/lib/Adapter.js (+47 -35)
src/lib/Bookmark.js (+0 -32)
📝 src/lib/Controller.js (+1 -0)
📝 src/lib/Crypto.js (+6 -0)
src/lib/LocalTree.js (+134 -0)
src/lib/Mappings.js (+75 -0)
src/lib/PathHelper.js (+19 -0)
src/lib/PathParse.js (+0 -15)
src/lib/Resource.js (+68 -0)
src/lib/SyncProcess.js (+514 -0)
📝 src/lib/Tree.js (+102 -241)
src/lib/adapters/Caching.js (+140 -0)
📝 src/lib/adapters/Fake.js (+23 -63)
📝 src/lib/adapters/Nextcloud.js (+237 -110)
📝 src/lib/adapters/WebDav.js (+1 -2)
📝 src/lib/components/Accounts.js (+4 -2)

...and 1 more files

📄 Description

@jlbprof I've decided to not implement a change list after all, as I need to keep track of the ids of the created items. For that it'd be better to have return values for each operations, ergo I used methods again for every operation. However, I realize that the caching you did in the WebDAV adapter could potentially be useful to other adapters, so I created an abstract CachingAdapter that already implements all the operations that work with the cache and only leaves the population and persistence of the cache to you.

I've also generalized the adapter operations into a Resource interface which the interface for the local tree inherits from as well, just for consistency. So, the sync step could potentially sync any two implementations of Resource.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/floccusaddon/floccus/pull/125 **Author:** [@marcelklehr](https://github.com/marcelklehr) **Created:** 6/8/2018 **Status:** ✅ Merged **Merged:** 6/22/2018 **Merged by:** [@marcelklehr](https://github.com/marcelklehr) **Base:** `develop` ← **Head:** `refactor/adapters` --- ### 📝 Commits (10+) - [`09315e2`](https://github.com/floccusaddon/floccus/commit/09315e2b21da5e0cbbfc525f6f96edbd26269d6e) Refactor: First draft of new APIs - [`eabadd3`](https://github.com/floccusaddon/floccus/commit/eabadd30f39f81b222d17fbac3ae7b5f1e89e384) Revamp sync process to sync real trees - [`ffe6eaa`](https://github.com/floccusaddon/floccus/commit/ffe6eaa778aa5e04950bd0530efd9e784842f750) Hash parentId for folders, too - [`396ada6`](https://github.com/floccusaddon/floccus/commit/396ada641252480c531770c1e06c538c410840fe) Finish up SyncProcess - [`2964ce8`](https://github.com/floccusaddon/floccus/commit/2964ce8a942f0be74feef4b6ea4260a8a8606845) Fix Mappings syntax - [`bf77eb5`](https://github.com/floccusaddon/floccus/commit/bf77eb5eb048cc0ad94cc2b14e905fa8e3b7f5a2) Fix Mappings class - [`441902b`](https://github.com/floccusaddon/floccus/commit/441902bed23617f4418909e78ecf5d9df9fe2f5c) Adjust Nextcloud adapter to new architecture - [`494ee20`](https://github.com/floccusaddon/floccus/commit/494ee206e6e9d61e967903535592cb62dbe38b12) Implement cache - [`022704b`](https://github.com/floccusaddon/floccus/commit/022704bac702321986f403d5529b71eba1680c0e) Make it pass gulp - [`6c73d85`](https://github.com/floccusaddon/floccus/commit/6c73d85ef867c917ddc7ee7f3b14c29abc93a379) Make it start ### 📊 Changes **21 files changed** (+1820 additions, -939 deletions) <details> <summary>View changed files</summary> 📝 `gulpfile.js` (+62 -42) 📝 `package.json` (+1 -0) 📝 `src/lib/Account.js` (+53 -194) 📝 `src/lib/AccountStorage.js` (+40 -53) 📝 `src/lib/Adapter.js` (+47 -35) ➖ `src/lib/Bookmark.js` (+0 -32) 📝 `src/lib/Controller.js` (+1 -0) 📝 `src/lib/Crypto.js` (+6 -0) ➕ `src/lib/LocalTree.js` (+134 -0) ➕ `src/lib/Mappings.js` (+75 -0) ➕ `src/lib/PathHelper.js` (+19 -0) ➖ `src/lib/PathParse.js` (+0 -15) ➕ `src/lib/Resource.js` (+68 -0) ➕ `src/lib/SyncProcess.js` (+514 -0) 📝 `src/lib/Tree.js` (+102 -241) ➕ `src/lib/adapters/Caching.js` (+140 -0) 📝 `src/lib/adapters/Fake.js` (+23 -63) 📝 `src/lib/adapters/Nextcloud.js` (+237 -110) 📝 `src/lib/adapters/WebDav.js` (+1 -2) 📝 `src/lib/components/Accounts.js` (+4 -2) _...and 1 more files_ </details> ### 📄 Description @jlbprof I've decided to not implement a change list after all, as I need to keep track of the ids of the created items. For that it'd be better to have return values for each operations, ergo I used methods again for every operation. However, I realize that the caching you did in the WebDAV adapter could potentially be useful to other adapters, so I created an abstract CachingAdapter that already implements all the operations that work with the cache and only leaves the population and persistence of the cache to you. I've also generalized the adapter operations into a Resource interface which the interface for the local tree inherits from as well, just for consistency. So, the sync step could potentially sync any two implementations of Resource. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 22:40:20 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/floccus#1472
No description provided.