Getting Timestamp not found in query response . with my dfx 0.9.3

What type of topic is this?
Discussion | Support | Bug Report

Motoko code:

import Debug "mo:base/Debug";
import Time "mo:base/Time";
import Float "mo:base/Float";

actor DBank {
  stable var currentValue : Float = 300;
  currentValue := 300;
  Debug.print(debug_show (currentValue));

  stable var startTime = Time.now();
  startTime := Time.now();
  Debug.print(debug_show (startTime));

  let id = 2348923840928349;
  // Debug.print(debug_show(id));

  public func topUp(amount : Float) {
    currentValue += amount;
    Debug.print(debug_show (currentValue));
  };

  public func withdraw(amount : Float) {
    let tempValue : Float = currentValue - amount;
    if (tempValue >= 0) {
      currentValue -= amount;
      Debug.print(debug_show (currentValue));
    } else {
      Debug.print("Amount too large, currentValue less than zero.");
    };
  };

  public query func checkBalance() : async Float {
    return currentValue;
  };

  // topUp();

  public func compound() {
    let currentTime = Time.now();
    let timeElapsedNS = currentTime - startTime;
    let timeElapsedS = timeElapsedNS / 1000000000;
    currentValue := currentValue * (1.01 ** Float.fromInt(timeElapsedS));
    startTime := currentTime;
  };

};

javascript code:

import {dbank} from "../../declarations/dbank";

window.addEventListener("load", async function() {
  const currentAmount= await dbank.checkBalance();
  console.log(response); // Log the response

  document.getElementById("value").innerText=Math.rount = (currentAmount*100)/100;
});

document.querySelector("form").addEventListener("submit",async function(event){
  console.log("Submit button clicked");

  const inputAmount = parseFloat(document.getElementById("input-amount").value);
  const outputAmount = parseFloat(document.getElementById("withdrawl-amount").value);

  await dbank.topUp(inputAmount);
  
  const currentAmount= await dbank.checkBalance();
   document.getElementById("value").innerText=Math.rount = (currentAmount*100)/100;
});

Canister is working fine and why you use

Debug.print(debug_show (startTime));

to see the time. Also tried commenting it out still getting
error

Timestamp not found in query response. This suggests a malformed or malicious response.
    at HttpAgent._HttpAgent_requestAndRetryQuery (http://localhost:8080/index.js:1052:15)
    at async makeQuery (http://localhost:8080/index.js:796:20)
    at async Promise.all (index 0)
    at async HttpAgent.query (http://localhost:8080/index.js:811:39)
    at async caller (http://localhost:8080/index.js:207:28)
    at async http://localhost:8080/index.js:21858:24
1 Like