fix: untitled override the true value in row details page (#6315)

* fix: untitled override the true value in row details page

* chore: use on complete edit callback

* chore: fix test

* chore: fix test

---------

Co-authored-by: Richard Shiue <71320345+richardshiue@users.noreply.github.com>
This commit is contained in:
Nathan.fooo 2024-09-16 13:19:36 +08:00 committed by GitHub
parent b865037728
commit f1bc9f860c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 74 additions and 67 deletions

View File

@ -1281,6 +1281,7 @@ extension AppFlowyDatabaseTest on WidgetTester {
); );
await enterText(textField, title); await enterText(textField, title);
await testTextInput.receiveAction(TextInputAction.done);
await pumpAndSettle(const Duration(milliseconds: 300)); await pumpAndSettle(const Duration(milliseconds: 300));
} }

View File

@ -553,7 +553,9 @@ class _TitleSkin extends IEditableTextCellSkin {
fontSize: 23, fontSize: 23,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
onChanged: (text) => bloc.add(TextCellEvent.updateText(text)), onEditingComplete: () {
bloc.add(TextCellEvent.updateText(textEditingController.text));
},
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(vertical: 9), contentPadding: const EdgeInsets.symmetric(vertical: 9),
border: InputBorder.none, border: InputBorder.none,

View File

@ -90,7 +90,7 @@ class _OpenRowPageButtonState extends State<OpenRowPageButton> {
), ),
onPressed: () { onPressed: () {
final name = state.content; final name = state.content;
_openRowPage(context, name); _openRowPage(context, name ?? "");
}, },
), ),
); );

View File

@ -34,7 +34,7 @@ class TextCellBloc extends Bloc<TextCellEvent, TextCellState> {
on<TextCellEvent>( on<TextCellEvent>(
(event, emit) { (event, emit) {
event.when( event.when(
didReceiveCellUpdate: (String content) { didReceiveCellUpdate: (content) {
emit(state.copyWith(content: content)); emit(state.copyWith(content: content));
}, },
didUpdateField: (fieldInfo) { didUpdateField: (fieldInfo) {
@ -44,7 +44,9 @@ class TextCellBloc extends Bloc<TextCellEvent, TextCellState> {
} }
}, },
updateText: (String text) { updateText: (String text) {
if (state.content != text) { // If the content is null, it indicates that either the cell is empty (no data)
// or the cell data is still being fetched from the backend and is not yet available.
if (state.content != null && state.content != text) {
cellController.saveCellData(text, debounce: true); cellController.saveCellData(text, debounce: true);
} }
}, },
@ -60,7 +62,7 @@ class TextCellBloc extends Bloc<TextCellEvent, TextCellState> {
_onCellChangedFn = cellController.addListener( _onCellChangedFn = cellController.addListener(
onCellChanged: (cellContent) { onCellChanged: (cellContent) {
if (!isClosed) { if (!isClosed) {
add(TextCellEvent.didReceiveCellUpdate(cellContent ?? "")); add(TextCellEvent.didReceiveCellUpdate(cellContent));
} }
}, },
onFieldChanged: _onFieldChangedListener, onFieldChanged: _onFieldChangedListener,
@ -76,7 +78,7 @@ class TextCellBloc extends Bloc<TextCellEvent, TextCellState> {
@freezed @freezed
class TextCellEvent with _$TextCellEvent { class TextCellEvent with _$TextCellEvent {
const factory TextCellEvent.didReceiveCellUpdate(String cellContent) = const factory TextCellEvent.didReceiveCellUpdate(String? cellContent) =
_DidReceiveCellUpdate; _DidReceiveCellUpdate;
const factory TextCellEvent.didUpdateField(FieldInfo fieldInfo) = const factory TextCellEvent.didUpdateField(FieldInfo fieldInfo) =
_DidUpdateField; _DidUpdateField;
@ -87,7 +89,7 @@ class TextCellEvent with _$TextCellEvent {
@freezed @freezed
class TextCellState with _$TextCellState { class TextCellState with _$TextCellState {
const factory TextCellState({ const factory TextCellState({
required String content, required String? content,
required ValueNotifier<String>? emoji, required ValueNotifier<String>? emoji,
required ValueNotifier<bool>? hasDocument, required ValueNotifier<bool>? hasDocument,
required bool enableEdit, required bool enableEdit,
@ -95,7 +97,7 @@ class TextCellState with _$TextCellState {
}) = _TextCellState; }) = _TextCellState;
factory TextCellState.initial(TextCellController cellController) { factory TextCellState.initial(TextCellController cellController) {
final cellData = cellController.getCellData() ?? ""; final cellData = cellController.getCellData();
final wrap = cellController.fieldInfo.wrapCellContent ?? true; final wrap = cellController.fieldInfo.wrapCellContent ?? true;
ValueNotifier<String>? emoji; ValueNotifier<String>? emoji;
ValueNotifier<bool>? hasDocument; ValueNotifier<bool>? hasDocument;

View File

@ -288,10 +288,8 @@ class _TitleTextCellSkin extends IEditableTextCellSkin {
textStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(fontSize: 14), textStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(fontSize: 14),
focusNode: focusNode, focusNode: focusNode,
hintText: LocaleKeys.calendar_defaultNewCalendarTitle.tr(), hintText: LocaleKeys.calendar_defaultNewCalendarTitle.tr(),
onChanged: (text) { onEditingComplete: () {
if (textEditingController.value.composing.isCollapsed) { bloc.add(TextCellEvent.updateText(textEditingController.text));
bloc.add(TextCellEvent.updateText(text));
}
}, },
); );
} }

View File

@ -122,9 +122,7 @@ class _TextCellState extends State<TextCardCell> {
child: BlocListener<TextCellBloc, TextCellState>( child: BlocListener<TextCellBloc, TextCellState>(
listenWhen: (previous, current) => previous.content != current.content, listenWhen: (previous, current) => previous.content != current.content,
listener: (context, state) { listener: (context, state) {
if (!state.enableEdit) { _textEditingController.text = state.content ?? "";
_textEditingController.text = state.content;
}
}, },
child: isTitle ? _buildTitle() : _buildText(), child: isTitle ? _buildTitle() : _buildText(),
), ),
@ -164,7 +162,7 @@ class _TextCellState extends State<TextCardCell> {
Widget _buildText() { Widget _buildText() {
return BlocBuilder<TextCellBloc, TextCellState>( return BlocBuilder<TextCellBloc, TextCellState>(
builder: (context, state) { builder: (context, state) {
final content = state.content; final content = state.content ?? "";
return content.isEmpty return content.isEmpty
? const SizedBox.shrink() ? const SizedBox.shrink()

View File

@ -79,10 +79,13 @@ class _TextCellState extends GridEditableTextCell<EditableTextCell> {
return BlocProvider.value( return BlocProvider.value(
value: cellBloc, value: cellBloc,
child: BlocListener<TextCellBloc, TextCellState>( child: BlocListener<TextCellBloc, TextCellState>(
listenWhen: (previous, current) => previous.content != current.content,
listener: (context, state) { listener: (context, state) {
if (!focusNode.hasFocus) { // It's essential to set the new content to the textEditingController.
_textEditingController.text = state.content; // If you don't, the old value in textEditingController will persist and
} // overwrite the correct value, leading to inconsistencies between the
// displayed text and the actual data.
_textEditingController.text = state.content ?? "";
}, },
child: Builder( child: Builder(
builder: (context) { builder: (context) {

View File

@ -510,10 +510,8 @@ class _TitleSkin extends IEditableTextCellSkin {
isDense: true, isDense: true,
isCollapsed: true, isCollapsed: true,
), ),
onChanged: (text) { onEditingComplete: () {
if (textEditingController.value.composing.isCollapsed) { bloc.add(TextCellEvent.updateText(textEditingController.text));
bloc.add(TextCellEvent.updateText(text));
}
}, },
), ),
); );

View File

@ -145,7 +145,7 @@ class _TitleSkin extends IEditableTextCellSkin {
TextEditingController textEditingController, TextEditingController textEditingController,
) { ) {
return BlocSelector<TextCellBloc, TextCellState, String>( return BlocSelector<TextCellBloc, TextCellState, String>(
selector: (state) => state.content, selector: (state) => state.content ?? "",
builder: (context, content) { builder: (context, content) {
final name = content.isEmpty final name = content.isEmpty
? LocaleKeys.grid_row_titlePlaceholder.tr() ? LocaleKeys.grid_row_titlePlaceholder.tr()

View File

@ -976,7 +976,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arc-swap", "arc-swap",
@ -1001,7 +1001,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-database" name = "collab-database"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -1032,7 +1032,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arc-swap", "arc-swap",
@ -1052,7 +1052,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -1072,7 +1072,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arc-swap", "arc-swap",
@ -1115,7 +1115,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -1195,7 +1195,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",

View File

@ -119,13 +119,13 @@ custom-protocol = ["tauri/custom-protocol"]
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
# Working directory: frontend # Working directory: frontend
# To update the commit ID, run: # To update the commit ID, run:

View File

@ -959,7 +959,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arc-swap", "arc-swap",
@ -984,7 +984,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-database" name = "collab-database"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -1015,7 +1015,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arc-swap", "arc-swap",
@ -1035,7 +1035,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -1055,7 +1055,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arc-swap", "arc-swap",
@ -1098,7 +1098,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -1178,7 +1178,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",

View File

@ -117,13 +117,13 @@ custom-protocol = ["tauri/custom-protocol"]
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
# Working directory: frontend # Working directory: frontend
# To update the commit ID, run: # To update the commit ID, run:

View File

@ -837,7 +837,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arc-swap", "arc-swap",
@ -862,7 +862,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-database" name = "collab-database"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -893,7 +893,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arc-swap", "arc-swap",
@ -913,7 +913,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -933,7 +933,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arc-swap", "arc-swap",
@ -976,7 +976,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -1056,7 +1056,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",

View File

@ -141,13 +141,13 @@ rocksdb = { git = "https://github.com/rust-rocksdb/rust-rocksdb", rev = "1710120
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" } collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
# Working directory: frontend # Working directory: frontend
# To update the commit ID, run: # To update the commit ID, run:

View File

@ -27,7 +27,10 @@ flowy-search = { workspace = true }
flowy-search-pub = { workspace = true } flowy-search-pub = { workspace = true }
collab-entity = { workspace = true } collab-entity = { workspace = true }
collab-plugins = { workspace = true } collab-plugins = { workspace = true }
collab = { workspace = true, features = ["verbose_log"] }
collab = { workspace = true }
#collab = { workspace = true, features = ["verbose_log"] }
diesel.workspace = true diesel.workspace = true
uuid.workspace = true uuid.workspace = true
flowy-storage = { workspace = true } flowy-storage = { workspace = true }

View File

@ -965,6 +965,7 @@ impl DatabaseEditor {
/// Update a cell in the database. /// Update a cell in the database.
/// This will notify all views that the cell has been updated. /// This will notify all views that the cell has been updated.
#[instrument(level = "trace", skip_all)]
pub async fn update_cell( pub async fn update_cell(
&self, &self,
view_id: &str, view_id: &str,
@ -974,6 +975,7 @@ impl DatabaseEditor {
) -> FlowyResult<()> { ) -> FlowyResult<()> {
// Get the old row before updating the cell. It would be better to get the old cell // Get the old row before updating the cell. It would be better to get the old cell
let old_row = self.get_row(view_id, row_id).await; let old_row = self.get_row(view_id, row_id).await;
trace!("[Database Row]: update cell: {:?}", new_cell);
self self
.update_row(row_id.clone(), |row_update| { .update_row(row_id.clone(), |row_update| {
row_update row_update