Cloud function not doing anything

Function had it working then added an extra uint256 value to my event changed the details for it in plugins and now nothing happens can’t even get anything from the logger.

Moralis.Cloud.beforeSave("BscClosedAuctions", async (request) => {
  const m = request.object.get('flag'); 
  const logger = Moralis.Cloud.getLogger();
  logger.info("flag ",m);
  logger.info("object: ",request.object);
  
    const AuctionBids = Moralis.Object.extend("BscAuctionItemBids");
    const bidQuery = new Moralis.Query("BscAuctionItemBids");
    bidQuery.equalTo("uid", request.object.get('uid'));
    const bidObject = await bidQuery.find();
    if(bidObject){
    for (let i = 0; i < bidObject.length; ++i){
      let auctionBid = new AuctionBids();
       bidObject[i].set('closed', true );
      auctionBid = bidObject[i];
       await auctionBid.save();
     }
    }
    const query = new Moralis.Query("BscItemsForAuction");
    query.equalTo("uid", request.object.get('uid'));
    const object = await query.first();
    if (object){
        const buyer = request.object.buyer;
        const userQuery = new Moralis.Query(Moralis.User);
        userQuery.equalTo("accounts", buyer);
      const userObject = await userQuery.first({useMasterKey:true});
      if (userObject){
          request.object.set('user', userObject);
      }
      request.object.set('auctionItem', object);
      object.set('closed', true);
      await object.save();
    }
  
  
 
/*
    const AuctionBids = Moralis.Object.extend("BscAuctionItemBids");
    const bidQuery = new Moralis.Query("BscAuctionItemBids");
    bidQuery.equalTo("uid", request.object.get('uid'));
    const bidObject = await bidQuery.find();
    if(bidObject){
    for (let i = 0; i < bidObject.length; ++i){
      let auctionBid = new AuctionBids();
       bidObject[i].set('claimed', true );
       auctionBid = bidObject[i];
       await auctionBid.save();
     }
    }
  */
    
  });

In my log it just says in BeforeSave [object object] thinking maybe im using a restricted word if flag is restricted?

my db log

2021-08-16T07:18:17.739Z - #11523675 ⏳ Bsc Balance Pending: 359690391999970715
2021-08-16T07:18:17.635Z - #11523675 ⏳ 0x97bd79759eaa636f2718ff0608bd0e06e6f0416975594c23c3797a4aeebbd5b4 0 Tx
2021-08-16T07:18:12.254Z - #11523661 βœ… 0xda73f4be105cd03b8efc3b1fbb1f30411e39162f3dd4eb4917d62b00e1e7c9a5 Log
2021-08-16T07:18:12.238Z - in beforeSave request = [object Object]
2021-08-16T07:18:12.220Z - #11523661 βœ… Bsc Balance Confirmed: 360334201999970715
2021-08-16T07:18:11.934Z - #11523661 βœ… 0xda73f4be105cd03b8efc3b1fbb1f30411e39162f3dd4eb4917d62b00e1e7c9a5 0 Tx

my sync event plugin

1 Like

found the issue forgot to remove th event tag from the topic in plugin

1 Like

Hey @PeacanDuck

Great job!

Keep working cool!
Happy BUIDLing :man_mechanic: