opensourceBIM / BIMserver

The open source BIMserver platform
GNU Affero General Public License v3.0
1.56k stars 611 forks source link

False-positive results for OID queries across multiple revisions #1333

Open hlg opened 3 weeks ago

hlg commented 3 weeks ago

When querying across multiple revisions (for example from different subprojects) with an ID (hence GUID or OID) query, under certain conditions false-positive results from other revisions are included. Currently this probably and wrongly als applies to "name" queries, since name attributes are treated as IDs as well. But have not tested with name queries yet. I also could not exactly narrow down the particular conditions under which this applies.

  1. As an example, checkin the buildingSMART dental clinic example with subprojects, in the order given on Github (alphabetical by name).
  2. From BIMvie.ws, execute the following query: { "type": "IfcBuilding", "oid": 66360} while replacing the "oid" value with the OID of the building with GUID 3eM8WbY_59RR5TDWry5aRU.
  3. Check number of buildings, there are two instead of one.

Instead, we expect just one building as a result. BIMvie.ws runs the query on a set of revisions that contains the last revision from each concrete subproject of the root project. Note that this does not happen with the IfcBuilding from the subproject checked in last. The issue seems to be that the revisions are queried and sometimes not just for the exact OID, but for the next equal or higher OID of the respective type.

This bug is particularly impactful for the default double-buffer queries as they rely exclusively on OID queries during the second pass. If for example, the above query is done by GUID instead of OID, it will return two buildings as well with the doublebuffer query but only one (correct) building with doublebuffer switched off.