bulltrackers-module 1.0.773 → 1.0.775

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.
@@ -46,7 +46,7 @@ module.exports = {
46
46
  },
47
47
 
48
48
  // System epoch - bump this to force all computations to re-run
49
- epoch: 'v2.0.1',
49
+ epoch: 'v2.0.2',
50
50
 
51
51
  // =========================================================================
52
52
  // BIGQUERY CONFIGURATION
@@ -95,7 +95,7 @@ class ManifestBuilder {
95
95
 
96
96
  // Hash Composition
97
97
  const usedLayers = this._detectLayerUsage(codeString);
98
- const { usedRules, hashes: ruleHashes } = this.rulesRegistry.detectUsage(codeString);
98
+ const { usedRules, hashes: ruleHashes } = this.rulesRegistry.detectUsage(codeString); // TODO : The usedRules is unused? Bug? Investigate.
99
99
 
100
100
  let compositeHash = codeHash + `|EPOCH:${this.epoch}`;
101
101
 
@@ -67,7 +67,6 @@ exports.dispatcherHandler = async (req, res) => {
67
67
  // =====================================================================
68
68
 
69
69
  // 2. Stale Task Protection
70
- // Prevents execution if the task was scheduled with an older version of the configuration
71
70
  if (configHash && !force) {
72
71
  const manifest = await system.getManifest();
73
72
 
@@ -76,9 +75,13 @@ exports.dispatcherHandler = async (req, res) => {
76
75
  const entry = manifest.find(c => c.name === normalizedName);
77
76
 
78
77
  if (entry) {
79
- // Re-calculate the hash of the CURRENTLY DEPLOYED code
80
- const input = JSON.stringify(entry.schedule) + `|PASS:${entry.pass}`;
81
- const currentHash = crypto.createHash('md5').update(input).digest('hex').substring(0, 8);
78
+ // OLD BROKEN LOGIC:
79
+ // const input = JSON.stringify(entry.schedule) + `|PASS:${entry.pass}`;
80
+ // const currentHash = crypto.createHash('md5').update(input).digest('hex').substring(0, 8);
81
+
82
+ // NEW CORRECT LOGIC:
83
+ // Use the authoritative hash from the Manifest (same one the Planner used)
84
+ const currentHash = entry.hash;
82
85
 
83
86
  // Compare Task Hash vs Current Hash
84
87
  if (configHash !== currentHash) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.773",
3
+ "version": "1.0.775",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [