Skip to content

fix: attempt to metaMerge only if we have something to merge #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-2022, macos-12, ubuntu-20.04]
os: [windows-2022, macos-13, ubuntu-20.04]
env:
SIGNAL_ENV: production
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"main": "index.js",
"name": "libsession_util_nodejs",
"description": "Wrappers for the Session Util Library",
"version": "0.4.11",
"version": "0.4.12",
"license": "GPL-3.0",
"author": {
"name": "Oxen Project",
Expand Down
13 changes: 8 additions & 5 deletions src/groups/meta_group_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,10 @@ Napi::Value MetaGroupWrapper::metaMerge(const Napi::CallbackInfo& info) {
toCppBufferView(itemObject.Get("data"), "meta.merge"));
}

auto info_merged = this->meta_group->info->merge(conf_strs);
count_merged += info_merged.size();
if(conf_strs.size()){
auto info_merged = this->meta_group->info->merge(conf_strs);
count_merged += info_merged.size();
}
}

if (!groupMember.IsNull() && !groupMember.IsUndefined()) {
Expand All @@ -362,9 +364,10 @@ Napi::Value MetaGroupWrapper::metaMerge(const Napi::CallbackInfo& info) {
toCppBufferView(itemObject.Get("data"), "meta.merge"));
}

auto member_merged = this->meta_group->members->merge(conf_strs);

count_merged += member_merged.size();
if(conf_strs.size()){
auto member_merged = this->meta_group->members->merge(conf_strs);
count_merged += member_merged.size();
}
}

if (this->meta_group->keys->needs_rekey()) {
Expand Down