Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
9b57b04
test(plugins): מדידת פעילות ורקע ב־Apple דרך מארחי האפליקציה
Y-PLONI Nov 8, 2026
6dc70ec
בדיקות Apple: אימות זהות הבקר והגדרות המדידה ושמירת כשלים
Y-PLONI Nov 8, 2026
627d67e
תיקון תמיכת watcher ב־iOS ואבחון הסתרת AppKit עם pin משולב
Y-PLONI Nov 8, 2026
b1b8c9c
fix: תיאום בקרי Apple ואימות שעונים ומקור המדידה
Y-PLONI Nov 8, 2026
9d0ca48
test(perf): diagnose active and bundled macOS controllers
Y-PLONI Nov 8, 2026
fc4ced0
fix(perf): השלמת דוחות Apple וקליטת מצב הרקע הנייטיבי
Y-PLONI Nov 8, 2026
e9bc29f
test(perf): אבחון מסירת אירועי AppKit בבקר חיצוני
Y-PLONI Nov 8, 2026
5704eb2
test(perf): אימות אותו יעד אחרי פתיחת חבילת macOS
Y-PLONI Nov 8, 2026
95185d5
fix(perf): שמירת מקור בניית iOS לפני הסרת הסימולטור
Y-PLONI Nov 8, 2026
f489cbf
fix(perf): שימור כשל הבקרה בעת כשל שמירת ראיות
Y-PLONI Nov 8, 2026
a645c74
fix(perf): שימור כשלים וזרמי ראיות בתעבורת בקר macOS
Y-PLONI Nov 8, 2026
b2472a0
test(perf): אבחון בקר macOS לאחר פתיחה ושמירת ראיות מוצר
Y-PLONI Nov 8, 2026
62dee57
test(perf): תיעוד תהליך וקבוצת ניקוי macOS בעת כשל
Y-PLONI Nov 8, 2026
0ff3cc6
test(perf): עיגון זהות מסמך Apple לפני שינוי הקרנת השעון
Y-PLONI Nov 8, 2026
9b255e1
test(perf): אבחון הפעלת יעד macOS מתחילתה דרך LaunchServices
Y-PLONI Nov 8, 2026
dd2981a
fix(perf): preserve native Apple hide controls with an explicit AX fa…
Y-PLONI Nov 8, 2026
b3b3ebf
fix(perf): reap failed native controllers before sending signals
Y-PLONI Nov 8, 2026
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
154 changes: 154 additions & 0 deletions .github/workflows/apple-plugin-activity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Apple installed plugin activity

on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/apple-plugin-activity.yml'
- 'integration_test/apple_plugin_activity_probe_test.dart'
- 'integration_test/support/apple_plugin_activity_fixture.dart'
- 'integration_test/support/installed_plugin_completion.dart'
- 'integration_test/support/perf_fixture.dart'
- 'integration_test/support/webview_probe_window.dart'
- 'test_driver/apple_plugin_activity.dart'
- 'tool/perf_probe/apple_plugin_activity/**'
- 'test/tool/perf_probe/apple_plugin_activity_contract_test.dart'
- 'test/tool/perf_probe/apple_plugin_activity_completion_test.dart'
- 'test/tool/perf_probe/installed_plugin_completion_test.dart'
- 'test/tool/perf_probe/perf_fixture_test.dart'
- 'test/tool/perf_probe/perf_fixture_startup_settings_test.dart'
- 'lib/app_scope/external_activation_service.dart'
- 'test/app_scope/external_activation_service_test.dart'
- 'lib/plugins/**'
- 'pubspec.yaml'
- 'pubspec.lock'

permissions:
contents: read

concurrency:
group: apple-plugin-activity-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
contracts:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7.0.1
- uses: subosito/flutter-action@v2
with:
flutter-version: 3.47.7
channel: stable
cache: true
- uses: dtolnay/rust-toolchain@stable
- name: Native source fallback prerequisites
run: sudo apt-get update && sudo apt-get install -y libclang-dev
- name: Resolve exact dependencies
run: flutter pub get --enforce-lockfile
- name: Counter, identity and boundary controls
run: |
set -euo pipefail
node --test tool/perf_probe/apple_plugin_activity/test_fixture.mjs
python3 -m unittest discover -s tool/perf_probe/apple_plugin_activity -p 'test_*.py' -v
ruby -c tool/perf_probe/apple_plugin_activity/create_control_project.rb
flutter test --no-pub \
test/tool/perf_probe/apple_plugin_activity_contract_test.dart \
test/tool/perf_probe/apple_plugin_activity_completion_test.dart \
test/tool/perf_probe/installed_plugin_completion_test.dart \
test/tool/perf_probe/perf_fixture_test.dart \
test/tool/perf_probe/perf_fixture_startup_settings_test.dart \
test/app_scope/external_activation_service_test.dart \
test/core/external_activation_channel_test.dart \
test/core/external_activation_queue_test.dart

actual-app:
name: Actual app (${{ matrix.platform }} ${{ matrix.mode }})
runs-on: macos-latest
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
include:
- platform: macos
mode: profile
- platform: ios
mode: debug
steps:
- name: Reserve time for cleanup and evidence
run: |
python3 - <<'PY'
import os, time
with open(os.environ['GITHUB_ENV'], 'a') as stream:
stream.write(f'APPLE_PROBE_DEADLINE_MONOTONIC={time.monotonic() + 65 * 60}\n')
PY
- uses: actions/checkout@v7.0.1
- uses: subosito/flutter-action@v2
with:
flutter-version: 3.47.7
channel: stable
cache: false
- uses: dtolnay/rust-toolchain@stable
- name: Native iOS Simulator source targets
if: matrix.platform == 'ios'
run: rustup target add aarch64-apple-ios-sim x86_64-apple-ios
- name: Resolve exact dependencies
run: flutter pub get --enforce-lockfile
- name: Select actual runtime
id: runtime_selection
env:
PROBE_PLATFORM: ${{ matrix.platform }}
run: |
set -euo pipefail
if [ "$PROBE_PLATFORM" = macos ]; then
echo 'APPLE_PROBE_DEVICE=macos' >> "$GITHUB_ENV"
else
ruby -e 'require "xcodeproj"'
xcrun simctl list devices available --json > "$RUNNER_TEMP/apple-devices.json"
python3 - <<'PY'
import json, os, subprocess
from pathlib import Path
data = json.loads(Path(os.environ['RUNNER_TEMP'], 'apple-devices.json').read_text())
candidates = [d for runtime, devices in data['devices'].items() if '.iOS-' in runtime
for d in devices if d['name'].startswith('iPhone') and d.get('isAvailable', True)]
if not candidates:
raise SystemExit('No available iPhone simulator; do not substitute a fake background transition')
device = next((d for d in candidates if d['state'] == 'Booted'), candidates[0])
if device['state'] != 'Booted':
subprocess.run(['xcrun', 'simctl', 'boot', device['udid']], check=True)
subprocess.run(['xcrun', 'simctl', 'bootstatus', device['udid'], '-b'], check=True)
with open(os.environ['GITHUB_ENV'], 'a') as stream:
stream.write('APPLE_PROBE_DEVICE=' + device['udid'] + '\n')
PY
open -a Simulator
fi
- name: Verify public identity and diagnose native macOS hide
id: mac_controls
if: matrix.platform == 'macos'
env:
APPLE_HELPER_CONTROL_OUTPUT: ${{ runner.temp }}/apple-helper-controls
run: python3 -m unittest discover -s tool/perf_probe/apple_plugin_activity -p 'test_macos_controller.py' -v
- name: Run installed app hosts and quiet OS transitions
# Collect product evidence after a helper-control failure; that failure remains fatal to this job.
if: ${{ !cancelled() && (success() || (matrix.platform == 'macos' && steps.runtime_selection.outcome == 'success' && steps.mac_controls.outcome == 'failure')) }}
run: >-
python3 tool/perf_probe/apple_plugin_activity/run.py
--platform '${{ matrix.platform }}' --mode '${{ matrix.mode }}'
--device "$APPLE_PROBE_DEVICE" --seconds 12
--output '${{ runner.temp }}/apple-plugin-activity'
- name: Preserve completed and partial evidence
if: always()
uses: actions/upload-artifact@v7.0.2
with:
name: apple-plugin-activity-${{ matrix.platform }}-${{ matrix.mode }}
path: |
${{ runner.temp }}/apple-plugin-activity/*.json
${{ runner.temp }}/apple-plugin-activity/*.log
${{ runner.temp }}/apple-plugin-activity/control/*.swift
${{ runner.temp }}/apple-plugin-activity/control/Control.xcodeproj
${{ runner.temp }}/apple-plugin-activity/control.xcresult
${{ runner.temp }}/apple-helper-controls/*.json
${{ runner.temp }}/apple-helper-controls/*.log
${{ runner.temp }}/apple-helper-controls/*.swift
if-no-files-found: warn
retention-days: 14
24 changes: 19 additions & 5 deletions docs/plugin-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ Otzaria.on('plugin.boot', (payload) => {
המופע נשאר בזיכרון. פינוי מופע ושחזורו מתוארים בנפרד בהמשך.
ב-Windows בקשת `TrySuspend` עשויה להידחות; רק תשובת הצלחה מהדפדפן מאשרת
שהמנוע מושהה. ב-Android אוצריא קוראת ל-`WebView.onPause`, שאינו משהה
JavaScript; ב-Linux הדף מסומן מוסתר, וב-macOS וב-iOS אין הקפאה כלל.
JavaScript; ב-Linux הדף מסומן מוסתר. ב-macOS וב-iOS אוצריא אינה מבקשת
הקפאת JavaScript במסלול הזה, אך WebKit ומערכת ההפעלה עדיין עשויים להאט או
להשהות אותו, למשל כשה-WebView מנותק מחלון או כשהאפליקציה ברקע.
**בכל הפלטפורמות התוסף אחראי לעצור polling, timers ועבודה מתמשכת** בעקבות
`plugin.suspended`, שנשלח לפני הבקשה הנייטיבית ואינו אישור להצלחתה.

Expand Down Expand Up @@ -317,8 +319,20 @@ Otzaria.on('plugin.resumed', start); // חזרה מהשהיה
Otzaria.on('plugin.suspended', stop); // עצירת timers / polling / WebSocket
```

> 💡 תוסף שרץ ברקע דרך הרשאת `app.run_on_startup` (`runMode: 'background'`) **אינו**
> מושהה — זו בדיוק מטרתו. ההשהיה חלה רק על ה-instance של הלשונית.
> 💡 אוצריא אינה מחילה את מדיניות ההשהיה של הלשונית על מופע עם
> `runMode: 'background'`. זו הבטחה של מנהל המופעים באפליקציה, ולא הבטחה
> ש-WebKit או מערכת ההפעלה יקצו לו זמן ריצה רציף. `startup.keepAlive: true`
> יחד עם הרשאת `app.background_keep_alive` מאושרת מונעים את תפוגת חוסר
> הפעילות של אוצריא; הם אינם מבטלים מגבלות של מערכת ההפעלה או קריסת תהליך תוכן.

ב-iOS 17 וב-macOS 14 ומעלה, Apple מתעדת שמדיניות
[`inactiveSchedulingPolicy`](https://developer.apple.com/documentation/webkit/wkpreferences/inactiveschedulingpolicy-swift.property)
חלה על WebView שאינו בחלון, ושברירת המחדל שלה היא `suspend` בכפוף לחריגים
שהמערכת מגדירה. אוצריא אינה משנה את המדיניות בניסוי
[מדידת הפעילות בתוך מארחי התוספים](../../tool/perf_probe/apple_plugin_activity/README.md).
צילום מצב נייטיבי הוא תיאור של רגע הקריאה; קריאת JavaScript או פקודה אחרי
החזרה אינן הוכחה שהקוד התקדם בזמן הרקע. יש לבדוק את מערכת ההפעלה, גרסת
WebKit, מצב הבנייה והתרחיש הרלוונטיים, ולתכנן חידוש עבודה בטוח.

`plugin.suspended` נמסר לפני בקשת ההשהיה למנוע, כדי שהתוסף יספיק לעצור
polling וטיימרים; הוא אינו אישור שהמנוע הקפיא JavaScript. ב-Windows אוצריא
Expand Down Expand Up @@ -881,9 +895,9 @@ Otzaria.on('plugin.boot', async (payload) => {
| אירוע מוצהר + הרשאת רקע מאושרת | WebView נסתר נוצר, `plugin.boot` נורה עם `runMode: 'background'`, ואז האירוע נמסר |
| המשתמש נכנס ללשונית התוסף | **instance נוסף** נוצר (foreground), ה-background נמשך במקביל |
| ההרשאה מבוטלת בהגדרות | ה-instance הרקע נסגר מיידית |
| החלון ממוזער או הלשונית מוסתרת | המופע ממשיך לרוץ — מופע רקע לעולם אינו מושהה ואינו מפונה |
| החלון ממוזער, הלשונית מוסתרת או האפליקציה ברקע | אוצריא אינה מבקשת להשהות את מופע הרקע כחלק ממדיניות הלשוניות; WebKit ומערכת ההפעלה עדיין עשויים להאט או להשהות אותו |
| תהליך הדפדפן שלו נפל | המופע נסגר, והטריגר הבא מעיר אותו. אחרי 3 נפילות ב-10 דקות הוא לא מוער עוד עד ההפעלה הבאה |
| אין פעילות במשך כ-3 דקות | המופע נסגר, אלא אם אושרה הרשאת keep-alive |
| אין פעילות במשך כ-3 דקות | המופע נסגר, אלא אם הוצהר `startup.keepAlive: true` וגם אושרה `app.background_keep_alive`. קריאות SDK ואירועים שנמסרים למופע נחשבים פעילות; התקדמות של טיימר JavaScript מקומי אינה מאריכה את הזמן |
| התוסף מוסר | כל ה-instances נסגרים, כולל מופעים נוספים של כרטיסיות |

---
Expand Down
Loading
Loading