holosphere 1.1.12 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/federation.js +25 -8
- package/holosphere-bundle.esm.js +33184 -0
- package/holosphere-bundle.js +33215 -0
- package/holosphere-bundle.min.js +39 -0
- package/package.json +78 -3
- package/.cursor/rules/futura.mdc +0 -55
- package/examples/federation.js +0 -162
- package/examples/hologram-updates-example.js +0 -106
- package/examples/holograms.js +0 -175
- package/test/auth.test.js +0 -275
- package/test/delete.test.js +0 -229
- package/test/federation.test.js +0 -349
- package/test/hologram-deletion.test.js +0 -197
- package/test/hologram-updates-return.test.js +0 -166
- package/test/hologram-updates.test.js +0 -143
- package/test/hologram.test.js +0 -316
- package/test/holosphere.test.js +0 -354
- package/test/meta-strip.test.js +0 -159
- package/test/parent-propagation.test.js +0 -138
- package/test/subscription.test.js +0 -364
package/federation.js
CHANGED
|
@@ -892,19 +892,36 @@ export async function propagate(holosphere, holon, lens, data, options = {}) {
|
|
|
892
892
|
if (propagateToParents) {
|
|
893
893
|
console.log(`[Federation] Starting parent propagation for holon: ${holon}`);
|
|
894
894
|
try {
|
|
895
|
-
//
|
|
895
|
+
// Validate if the holon is a proper H3 hexagon
|
|
896
|
+
// H3 hexagons should start with '8' and have a valid format
|
|
896
897
|
let holonResolution;
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
898
|
+
let isValidH3 = false;
|
|
899
|
+
|
|
900
|
+
// First check: H3 hexagons should start with '8' and be at least 15 characters long
|
|
901
|
+
if (typeof holon === 'string' && holon.startsWith('8') && holon.length >= 15) {
|
|
902
|
+
try {
|
|
903
|
+
holonResolution = h3.getResolution(holon);
|
|
904
|
+
// Additional validation: resolution should be >= 0 and <= 15
|
|
905
|
+
if (holonResolution >= 0 && holonResolution <= 15) {
|
|
906
|
+
isValidH3 = true;
|
|
907
|
+
console.log(`[Federation] Holon ${holon} is valid H3 hexagon with resolution: ${holonResolution}`);
|
|
908
|
+
} else {
|
|
909
|
+
console.log(`[Federation] Holon ${holon} has invalid resolution: ${holonResolution}`);
|
|
910
|
+
}
|
|
911
|
+
} catch (error) {
|
|
912
|
+
console.log(`[Federation] Holon ${holon} failed H3 validation: ${error.message}`);
|
|
913
|
+
}
|
|
914
|
+
} else {
|
|
915
|
+
console.log(`[Federation] Holon ${holon} is not a valid H3 hexagon: does not start with '8' or too short`);
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
if (!isValidH3) {
|
|
919
|
+
console.log(`[Federation] Skipping parent propagation for non-H3 holon: ${holon}`);
|
|
903
920
|
result.parentPropagation.messages.push(`Holon ${holon} is not a valid H3 hexagon. Skipping parent propagation.`);
|
|
904
921
|
result.parentPropagation.skipped++;
|
|
905
922
|
}
|
|
906
923
|
|
|
907
|
-
if (holonResolution !== undefined) {
|
|
924
|
+
if (isValidH3 && holonResolution !== undefined) {
|
|
908
925
|
// Get all parent hexagons up to the specified max levels
|
|
909
926
|
const parentHexagons = [];
|
|
910
927
|
let currentHolon = holon;
|