gh-15088: Prevent sync if engine is already applying (gh-15137)

This commit is contained in:
mr. m
2026-08-27 23:38:47 +02:00
committed by GitHub
parent 9e0c790602
commit 4746d36699
6 changed files with 85 additions and 27 deletions

View File

@@ -27,17 +27,10 @@ $token = gh auth token
$env:SURFER_MOZCONFIG_ONLY="1"
$env:SURFER_SIGNING_MODE=""
# Fetch SignIdentity from the github repo secrets, with the name SURFER_CERT_PATCH_ISSUER
$SignIdentityIssuer = (Invoke-RestMethod -Uri "https://api.github.com/repos/zen-browser/desktop/actions/secrets/SURFER_CERT_PATCH_ISSUER" -Headers @{Authorization = "Bearer $token"}).value
$SignIdentity = (Invoke-RestMethod -Uri "https://api.github.com/repos/zen-browser/desktop/actions/secrets/SURFER_CERT_PATCH_NAME" -Headers @{Authorization = "Bearer $token"}).value
$SignIndentityIssuerPrev = (Invoke-RestMethod -Uri "https://api.github.com/repos/zen-browser/desktop/actions/secrets/SURFER_CERT_PATCH_ISSUER_PREV" -Headers @{Authorization = "Bearer $token"}).value
$SignIdentityPrev = (Invoke-RestMethod -Uri "https://api.github.com/repos/zen-browser/desktop/actions/secrets/SURFER_CERT_PATCH_NAME_PREV" -Headers @{Authorization = "Bearer $token"}).
$env:SURFER_CERT_PATCH_ISSUER=$SignIdentityIssuer
$env:SURFER_CERT_PATCH_NAME=$SignIdentity
$env:SURFER_CERT_PATCH_NAME_PREV=$SignIdentityPrev
$env:SURFER_CERT_PATCH_ISSUER_PREV=$SignIndentityIssuerPrev
get-content "$PSScriptRoot/../.env" | foreach {
$name, $value = $_.split('=')
set-content env:\$name $value
}
Start-Job -Name "DownloadGitl10n" -ScriptBlock {
param($PWD)

View File

@@ -0,0 +1,29 @@
diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp
index f760a6bb887b321376761431886c771f14fd03af..d52110ba52a95ef7c7bfb915e120b8dd636c9448 100644
--- a/widget/gtk/nsDragService.cpp
+++ b/widget/gtk/nsDragService.cpp
@@ -23,6 +23,7 @@
#include "mozilla/StaticPrefs_widget.h"
#include "mozilla/WidgetUtils.h"
#include "mozilla/WidgetUtilsGtk.h"
+#include "mozilla/nsZenDragAndDrop.h"
#include "nsAppShell.h"
#include "nsArrayUtils.h"
#include "nsCRT.h"
@@ -2304,11 +2305,15 @@ bool nsDragSession::SetAlphaPixmap(SourceSurface* aSurface,
cairo_image_surface_get_stride(surf), SurfaceFormat::B8G8R8A8);
if (!dt) return false;
+ auto drag_translucency = DRAG_IMAGE_ALPHA_LEVEL;
+ if (auto zenDragAndDrop = zen::nsZenDragAndDrop::GetZenDragAndDropInstance()) {
+ drag_translucency = zenDragAndDrop->GetDragImageOpacity();
+ }
dt->ClearRect(Rect(0, 0, dragRect.width, dragRect.height));
dt->DrawSurface(
aSurface, Rect(0, 0, dragRect.width, dragRect.height),
Rect(0, 0, dragRect.width, dragRect.height), DrawSurfaceOptions(),
- DrawOptions(DRAG_IMAGE_ALPHA_LEVEL, CompositionOp::OP_SOURCE));
+ DrawOptions(drag_translucency, CompositionOp::OP_SOURCE));
cairo_surface_mark_dirty(surf);
cairo_surface_set_device_offset(surf, -aXOffset, -aYOffset);

View File

@@ -78,13 +78,13 @@
}
.zen-sidebar-notification-progress {
height: 2px;
height: 1px;
overflow: hidden;
transform: translateY(-1px);
& .zen-sidebar-notification-progress-bar {
height: 100%;
background: light-dark(color-mix(in srgb, var(--zen-primary-color) 50%, black), color-mix(in srgb, var(--zen-colors-primary) 15%, #ebebeb));
background: light-dark(color-mix(in srgb, var(--zen-primary-color) 50%, black), color-mix(in srgb, var(--zen-colors-primary) 15%, transparent 10%, #6b6b6b));
transform-origin: left center;
}
}

View File

@@ -183,10 +183,10 @@
if (tabClone.hasAttribute("visuallyselected")) {
tabClone.style.transform = "translate(-50%, -50%)";
}
} else if (AppConstants.platform !== "macosx" && !tab.isZenFolder) {
// On windows and linux, we still don't add some extra opaqueness
// for the tab to be more visible. This is a hacky workaround.
// TODO: Make windows and linux DnD use nsZenDragAndDrop::mDragImageOpacity
} else if (AppConstants.platform == "win" && !tab.isZenFolder) {
// On windows, the shell applies its own translucency to the drag
// image which we can't control, so force some extra contrast for
// the tab to be more visible. This is a hacky workaround.
tabClone.style.colorScheme = "light";
tabClone.style.setProperty("--tab-selected-textcolor", "black");
}

View File

@@ -81,6 +81,16 @@ class ZenSpacesSyncStore extends Store {
* score is only bumped when something actually differs.
*/
class ZenSpacesSyncTracker extends Tracker {
_ignoreAll = false;
get ignoreAll() {
return this._ignoreAll;
}
set ignoreAll(value) {
this._ignoreAll = value;
}
onStart() {
for (const topic of TRACKED_TOPICS) {
Services.obs.addObserver(this, topic);
@@ -94,6 +104,9 @@ class ZenSpacesSyncTracker extends Tracker {
}
observe(subject, topic) {
if (this.ignoreAll) {
return;
}
if (topic !== SIDEBAR_COLLECTED_TOPIC) {
ZenSpacesSyncModel.invalidate();
}

View File

@@ -152,6 +152,16 @@ class nsZenSpacesSyncModel {
data.version = STORE_VERSION;
data.uploaded ||= {};
data.containers ||= {};
// The container map used to be keyed by guid. It is keyed by
// userContextId now so that registering a guid replaces any
// previous one for the same container. Flip old stores over
// (old values are numeric ids, new values are guid strings).
for (const [key, value] of Object.entries(data.containers)) {
if (typeof value === "number") {
delete data.containers[key];
data.containers[value] = key;
}
}
return data;
},
});
@@ -175,16 +185,15 @@ class nsZenSpacesSyncModel {
return `${BUILTIN_GUID_PREFIX}${id}`;
}
const data = this.#data();
for (const [guid, mapped] of Object.entries(data.containers)) {
if (mapped === id) {
return guid;
}
const existing = data.containers[id];
if (existing) {
return existing;
}
if (!create) {
return null;
}
const guid = Services.uuid.generateUUID().toString().slice(1, -1);
data.containers[guid] = id;
data.containers[id] = guid;
this.#file.saveSoon();
return guid;
}
@@ -199,22 +208,36 @@ class nsZenSpacesSyncModel {
? id
: null;
}
return this.#data().containers[guid] ?? null;
for (const [id, mapped] of Object.entries(this.#data().containers)) {
if (mapped === guid) {
return Number(id);
}
}
return null;
}
/**
* Adopts an incoming guid as the identity's synced name.
*
* @param {string} guid
* @param {number} userContextId
*/
registerContainerGuid(guid, userContextId) {
if (guid.startsWith(BUILTIN_GUID_PREFIX)) {
return;
}
this.#data().containers[guid] = userContextId;
this.#data().containers[userContextId] = guid;
this.#file.saveSoon();
}
forgetContainerGuid(guid) {
const data = this.#data();
if (guid in data.containers) {
delete data.containers[guid];
this.#file.saveSoon();
for (const [id, mapped] of Object.entries(data.containers)) {
if (mapped === guid) {
delete data.containers[id];
this.#file.saveSoon();
return;
}
}
}