Skip to content

Commit 93a0e0a

Browse files
committed
Implement crdt
1 parent ab1b401 commit 93a0e0a

53 files changed

Lines changed: 3844 additions & 2705 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
name: Publish Release
1+
name: build
22
on:
33
release:
44
types: [published]
55

6-
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
10+
pull_request:
11+
branches:
12+
- main
713

814
env:
915
JAVA_VERSION: 17
@@ -56,6 +62,7 @@ jobs:
5662
tar -czvf mapping.tar.gz --directory=app/build/reproducible/mapping mapping
5763
5864
- name: Sign APKs
65+
if: github.event_name == 'release'
5966
env:
6067
KEYSTORE: ${{ secrets.KEYSTORE }}
6168
KEYALIAS: ${{ secrets.KEYALIAS }}
@@ -77,7 +84,20 @@ jobs:
7784
done
7885
rm keystore.p12
7986
87+
- name: Upload artifacts (workflow run)
88+
if: github.event_name != 'release'
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: stride-artifacts
92+
path: |
93+
app-armeabi-v7a-release.apk
94+
app-arm64-v8a-release.apk
95+
app-x86_64-release.apk
96+
app-release.apk
97+
mapping.tar.gz
98+
8099
- name: Upload Arifact armeabi-v7a
100+
if: github.event_name == 'release'
81101
uses: svenstaro/upload-release-action@v2
82102
with:
83103
repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -86,6 +106,7 @@ jobs:
86106
tag: ${{ github.ref }}
87107

88108
- name: Upload Arifact arm64-v8a
109+
if: github.event_name == 'release'
89110
uses: svenstaro/upload-release-action@v2
90111
with:
91112
repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -94,6 +115,7 @@ jobs:
94115
tag: ${{ github.ref }}
95116

96117
- name: Upload Arifact x86_64
118+
if: github.event_name == 'release'
97119
uses: svenstaro/upload-release-action@v2
98120
with:
99121
repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -102,6 +124,7 @@ jobs:
102124
tag: ${{ github.ref }}
103125

104126
- name: Upload Arifact Universal
127+
if: github.event_name == 'release'
105128
uses: svenstaro/upload-release-action@v2
106129
with:
107130
repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -110,6 +133,7 @@ jobs:
110133
tag: ${{ github.ref }}
111134

112135
- name: Upload Arifact Mapping
136+
if: github.event_name == 'release'
113137
uses: svenstaro/upload-release-action@v2
114138
with:
115139
repo_token: ${{ secrets.GITHUB_TOKEN }}

Cargo.lock

Lines changed: 34 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
resolver = "3"
33
members = [
44
"crates/core",
5+
"crates/crdt",
6+
"crates/serialization",
57
"crates/logging",
68
"crates/database",
79
"crates/backend",
@@ -28,6 +30,8 @@ description = "An extensible task menagment application that uses git as it's da
2830
[workspace.dependencies]
2931
# Repository Crates
3032
stride_core = { version = "~0.1.0", path = "crates/core", default-features = false }
33+
stride_crdt = { version = "~0.1.0", path = "crates/crdt" }
34+
stride_serialize = { version = "~0.1.0", path = "crates/serialization" }
3135
stride_logging = { version = "~0.1.0", path = "crates/logging" }
3236
stride_database = { version = "~0.1.0", path = "crates/database" }
3337
stride_backend = { version = "~0.1.0", path = "crates/backend" }
@@ -84,6 +88,7 @@ clap = { version = "4.5.54", features = ["derive"] }
8488
url = { version = "2.5.8", features = ["serde"] }
8589
thiserror = "2.0.18"
8690
indoc = "2.0.7"
91+
vint64 = "=1.0.1"
8792

8893
[profile.release]
8994
# strip = "debug"

app/lib/blocs/plugin_manager_bloc.dart

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ class PluginManagerBloc extends Bloc<PluginManagerEvent, PluginManagerState> {
109109
if (error.isOutOfFuelTrapCode()) {
110110
final pluginName = error.pluginName();
111111
if (pluginName != null) {
112-
disable(
113-
pluginName,
114-
reason: 'plugin exceeded computation limit',
115-
);
112+
disable(pluginName, reason: 'plugin exceeded computation limit');
116113

117114
logBloc.add(
118115
LogErrorEvent(
@@ -149,7 +146,7 @@ class PluginManagerBloc extends Bloc<PluginManagerEvent, PluginManagerState> {
149146
TaskAddEvent(
150147
task: task.copyWith(
151148
// Make sure to give a new UUID that what the plugin provided.
152-
uuid: UuidValue.fromString(const Uuid().v7()),
149+
id: UuidValue.fromString(const Uuid().v7()),
153150
),
154151
),
155152
);
@@ -168,21 +165,23 @@ class PluginManagerBloc extends Bloc<PluginManagerEvent, PluginManagerState> {
168165
ty == NetworkRequestType.get_,
169166
'expected network request to have GET method',
170167
);
171-
http.get(Uri.parse(host)).then(
172-
(value) async {
173-
await pm.emit(
174-
pluginName: pluginName,
175-
event: HostEvent.networkResponse(
176-
host: host,
177-
content: value.bodyBytes,
178-
),
168+
http
169+
.get(Uri.parse(host))
170+
.then(
171+
(value) async {
172+
await pm.emit(
173+
pluginName: pluginName,
174+
event: HostEvent.networkResponse(
175+
host: host,
176+
content: value.bodyBytes,
177+
),
178+
);
179+
},
180+
onError: (error) {
181+
// TODO: Log error/notify
182+
print(error);
183+
},
179184
);
180-
},
181-
onError: (error) {
182-
// TODO: Log error/notify
183-
print(error);
184-
},
185-
);
186185
}
187186
case PluginAction_Disable(:final pluginName, :final reason):
188187
logBloc.add(

app/lib/blocs/tasks_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class TaskBloc extends Bloc<TaskEvent, TaskState> {
137137

138138
on<TaskRemoveEvent>((event, emit) async {
139139
if (event.task.status == TaskStatus.deleted) {
140-
await repository()?.purgeTaskById(id: event.task.uuid);
140+
await repository()?.purgeTaskById(id: event.task.id);
141141
} else {
142142
await repository()?.updateTask(
143143
task: event.task.copyWith(status: TaskStatus.deleted),

0 commit comments

Comments
 (0)