areIdentical() returns true for different files when filesystem reports 0n inode values
I encountered an issue when using fs.move*() against files accessed through the Citrix Client Drive Mapping (CDM) virtual filesystem. When calling fs.stat*(path, { bigint: true }) on files under a CDM path, every file appears to report { ino: 0n }
I verified this by enumerating an entire directory and collecting stat information for every file. The inode value was always reported as 0n. As a result, areIdentical() returns true for different files because both files have matching dev and ino values. This causes fs.move*() to throw: "Source and destination must not be the same." even when the source and destination are clearly different files.
This behavior appears to have been introduced by #1050. Prior to that change, the falsy value of 0n prevented the inode comparison from succeeding. After #1050, 0n is treated as a valid inode for comparison.
It seems for this filesystem specifically, and maybe others, that matching (dev, ino) values are not sufficient to establish an identical file.
Source: jprichardson/node-fs-extra