The upgrade function is used repeatedly with the current version of the smart contract as an argument for the new version, but instead, a new one should be deployed

I was using a proxy, and everything was working fine, but at some point during an upgrade, the plugin started calling the upgradeTo function with the old implementation as the argument.

This makes further upgrades impossible.

It might be related to the forceImport function.

Could you please explain why this happens?

pragma solidity ^0.8.9;
contract View is UUPSUpgradeable, Initializable{}

    "@openzeppelin/contracts-upgradeable": "^4.9.6",
    "@openzeppelin/hardhat-upgrades": "^3.0.1",
    "hardhat": "^2.22.12",

    contract = await upgrades.upgradeProxy(contractAddress, contractFactory)


  const contractFactory = await ethers.getContractFactory(contractName, {
    libraries: libs,
  })

  const _ = await upgrades.forceImport(contractAddress, contractFactory)

I guess the answer might be the redeployImplementation: "always" flag.

But I’m wondering — why would I call upgrades.upgradeProxy if I don’t actually want to update anything?

It still calls upgradeTo, but with the old implementation — that’s literally doing nothing.