update
This commit is contained in:
@@ -40,10 +40,11 @@ async function test_mix_receive() {
|
||||
}
|
||||
);
|
||||
|
||||
log_trace(`Received ${result.length} payloads`);
|
||||
log_trace(`Received ${result.payloads.length} payloads`);
|
||||
|
||||
// Result is a list of {dataname, data, type} objects
|
||||
for (const { dataname, data, type } of result) {
|
||||
// Result is an envelope dictionary with payloads field
|
||||
// Access payloads with result.payloads
|
||||
for (const { dataname, data, type } of result.payloads) {
|
||||
log_trace(`\n=== Payload: ${dataname} (type: ${type}) ===`);
|
||||
|
||||
// Handle different data types
|
||||
@@ -122,13 +123,13 @@ async function test_mix_receive() {
|
||||
|
||||
// Summary
|
||||
console.log("\n=== Verification Summary ===");
|
||||
const text_count = result.filter(x => x.type === "text").length;
|
||||
const dict_count = result.filter(x => x.type === "dictionary").length;
|
||||
const table_count = result.filter(x => x.type === "table").length;
|
||||
const image_count = result.filter(x => x.type === "image").length;
|
||||
const audio_count = result.filter(x => x.type === "audio").length;
|
||||
const video_count = result.filter(x => x.type === "video").length;
|
||||
const binary_count = result.filter(x => x.type === "binary").length;
|
||||
const text_count = result.payloads.filter(x => x.type === "text").length;
|
||||
const dict_count = result.payloads.filter(x => x.type === "dictionary").length;
|
||||
const table_count = result.payloads.filter(x => x.type === "table").length;
|
||||
const image_count = result.payloads.filter(x => x.type === "image").length;
|
||||
const audio_count = result.payloads.filter(x => x.type === "audio").length;
|
||||
const video_count = result.payloads.filter(x => x.type === "video").length;
|
||||
const binary_count = result.payloads.filter(x => x.type === "binary").length;
|
||||
|
||||
log_trace(`Text payloads: ${text_count}`);
|
||||
log_trace(`Dictionary payloads: ${dict_count}`);
|
||||
@@ -140,7 +141,7 @@ async function test_mix_receive() {
|
||||
|
||||
// Print transport type info for each payload if available
|
||||
console.log("\n=== Payload Details ===");
|
||||
for (const { dataname, data, type } of result) {
|
||||
for (const { dataname, data, type } of result.payloads) {
|
||||
if (["image", "audio", "video", "binary"].includes(type)) {
|
||||
log_trace(`${dataname}: ${data.length} bytes (binary)`);
|
||||
} else if (type === "table") {
|
||||
|
||||
Reference in New Issue
Block a user