Metabridge Changelog
All notable changes to this project will be documented in this file.
[1.0.4] - 2026-03-03
Fixed
MetaBridge:invokeCallbackserver net event now silently returns when the requested callback is not registered in the current Lua state, instead of immediately firing aMetaBridge:callbackResponseerror back to the client. This eliminates a race condition where themetabridgeresource's own Lua state (which holds no downstream resource callbacks) would respond withsuccess = falsebefore the resource that actually owns the callback could respond with the real result. The previous behaviour caused everyrequestCallbackAwaitcall in resources that embedmetabridgevia@metabridge/init.lua(withoutox_libin their ownshared_scripts) to silently receivenil.
Compatibility
- Public exports, events, and method signatures remain unchanged.
- Both resource mode and
@metabridge/init.luainclude mode remain supported.
[1.0.3] - 2026-02-20
Added
- Server bridge inventory methods:
getItemDefinition(source, itemName)removeItemExact(source, itemName, amount, meta, slot)registerCreateItemHook(handler, options)
- Server callbacks for client-side inventory abstractions:
MetaBridge:getItemCountMetaBridge:getItemDefinition
- Client bridge methods:
getItemCount(itemName, meta)hasItem(itemName, amount, meta)displayMetadata(metadataMap)addTargetLocalEntity(entity, options)— adds target options to a local (non-networked) entity; routes toox_target,qb-target, orqtarget.removeTargetLocalEntity(entity)— removes all target options from a local entity; same fallback chain.removeTargetModel(models)— removes model-based targets registered viaaddTargetModel.alertDialog(data)— shows a confirm/cancel alert dialog; defaults tolib.alertDialog, overridable viaBridgeConfig.alertDialog.client.addZoneSphere(data)— creates a proximity sphere zone; defaults tolib.zones.sphere, overridable viaBridgeConfig.zones.sphere.addPoint(data)— creates a proximity tracking point; defaults tolib.points.new, overridable viaBridgeConfig.points.new.requestModel(model, timeoutMs)— loads a model hash and waits until ready; returnsboolean.
Fixed
- Fixed
requestCallbackAwaitinresource/client.luato preserve all return values fromlib.callback.await(including multi-return responses). - Hardened
getJobresolution for QBCore/Qbox and added fallback extraction from normalized player payloads to reduce unexpectedniljob results.
Changed
- Added bridge debug mode support via
BridgeConfig.debugand runtime diagnostics in shared/core adapter paths. - Centralized repeated vehicle helper logic (
setFuel,giveVehicleKeys) inresource/shared.luaand reused it across framework adapters. - Converted
adapters/*.luaandinventories/*.luato shim-only compatibility files that forward-load canonical implementations. - Removed leftover duplicate/unused helper logic from active framework files during cleanup.
- Extended inventory adapters with item-definition and exact-removal support.
- Updated
ox_inventoryadapter to support bridge-levelcreateItemhook registration. - Enabled downstream resources to stop calling
ox_inventorydirectly for item counts, metadata display, and slot-targeted removals.
Compatibility
- Public exports, events, and method signatures remain unchanged.
- Both resource mode and
@metabridge/init.luainclude mode remain supported.
[1.0.2] - 2026-02-20
Changed
- Added shared helper utilities in
resource/shared.luafor safe export invocation and notification payload normalization. - Updated runtime bridge code (
resource/client.lua,resource/bridge.lua) to use shared helpers instead of duplicated local implementations. - Removed duplicate client export declarations from
resource/client.lua; client export registration now has a single source of truth inexports/client.lua. - Added legacy compatibility forward-load shims in
adapters/*.luaandinventories/*.luaso those paths always execute canonical implementations inlinks/frameworks/*.luaandlinks/inventories/*.lua.
Compatibility
- Public exports, events, and method signatures remain unchanged.
- Both resource mode and
@metabridge/init.luainclude mode remain supported.
[1.0.1] - 2026-02-19
Added
- Server bridge API methods:
canCarryWeight(source, weight)getEmptySlot(source)getSlotsWithItem(source, itemName, meta)setItemMetadata(source, slot, metadata)
ox_inventoryadapter support for the methods above.- Framework inventory adapter fallback implementations for safer cross-inventory behavior.
Notes
- These additions are exported through
exports/server.luaautomatically with the rest ofMetaBridgemethods. - This update fixes missing-method runtime issues in resources that rely on inventory capacity checks, slot scans, and metadata updates.
