forked from 1b-agent/opencadstudio-upstream
fix(plugins): Python plugins see the host document again
Plugins read the host's document through a shared reference across the dynamic-library boundary, and the entity index hashed with foldhash's per-process seed, so every handle lookup from the plugin missed. The codec now uses a fixed hasher (opencadcodec f385f75; kernel 9841749, graph e9c23ad). The Python IPC suite also caught up with intended changes: ATTDEF renders its tag, DXF now keeps the lock-position flag, and the modify audit turns associative arrays off since it checks loose copies. The rate-limiter test waits for the host's check instead of a fixed sleep that raced on macOS, and ENV_LOCK no longer cascades a poisoned lock into every later test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c48fac7ae9
commit
ee2898095e
11 files changed
+43
-42
No files matched your search
@@ -108,14 +108,14 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn effective_max_defaults_to_api_version() {
|
||||
let _guard = ENV_LOCK.lock().unwrap();
|
||||
let _guard = ENV_LOCK.lock().unwrap_or_else(|e| e.into_inner());
|
||||
std::env::remove_var(MAX_API_VERSION_ENV);
|
||||
assert_eq!(effective_max_api_version(), API_VERSION);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn effective_max_can_disable_v4() {
|
||||
let _guard = ENV_LOCK.lock().unwrap();
|
||||
let _guard = ENV_LOCK.lock().unwrap_or_else(|e| e.into_inner());
|
||||
std::env::set_var(MAX_API_VERSION_ENV, "3");
|
||||
assert_eq!(effective_max_api_version(), 3);
|
||||
assert!(!host_accepts_plugin_version(4));
|
||||
@@ -126,7 +126,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn effective_max_below_minimum_is_v3_only_mode() {
|
||||
let _guard = ENV_LOCK.lock().unwrap();
|
||||
let _guard = ENV_LOCK.lock().unwrap_or_else(|e| e.into_inner());
|
||||
std::env::set_var(MAX_API_VERSION_ENV, "2");
|
||||
assert_eq!(effective_max_api_version(), 3);
|
||||
assert!(!host_accepts_plugin_version(4));
|
||||
@@ -137,7 +137,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn effective_max_clamps_to_supported_range() {
|
||||
let _guard = ENV_LOCK.lock().unwrap();
|
||||
let _guard = ENV_LOCK.lock().unwrap_or_else(|e| e.into_inner());
|
||||
std::env::set_var(MAX_API_VERSION_ENV, "99");
|
||||
assert_eq!(effective_max_api_version(), API_VERSION);
|
||||
std::env::set_var(MAX_API_VERSION_ENV, "1");
|
||||
@@ -147,7 +147,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn host_accepts_supported_range() {
|
||||
let _guard = ENV_LOCK.lock().unwrap();
|
||||
let _guard = ENV_LOCK.lock().unwrap_or_else(|e| e.into_inner());
|
||||
std::env::remove_var(MAX_API_VERSION_ENV);
|
||||
assert!(host_accepts_plugin_version(API_VERSION_MIN_SUPPORTED));
|
||||
assert!(host_accepts_plugin_version(API_VERSION));
|
||||
|
||||
Reference in new issue
Block a user