Skip to content

Commit

Permalink
Merge pull request #8 from Bilb/fix-attempt-merge-only-if-msgs
Browse files Browse the repository at this point in the history
fix: attempt to metaMerge only if we have something to merge
  • Loading branch information
Bilb authored Jan 15, 2025
2 parents 526e771 + 7e3a651 commit ffa6203
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
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

0 comments on commit ffa6203

Please sign in to comment.