<?xml version="1.0" encoding="UTF-8"?><oembed><type>video</type><version>1.0</version><html>&lt;iframe src=&quot;https://www.loom.com/embed/77efaa71a3c5462d855c2e52816e397c&quot; frameborder=&quot;0&quot; width=&quot;1662&quot; height=&quot;1246&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;</html><height>1246</height><width>1662</width><provider_name>Loom</provider_name><provider_url>https://www.loom.com</provider_url><thumbnail_height>1246</thumbnail_height><thumbnail_width>1662</thumbnail_width><thumbnail_url>https://cdn.loom.com/sessions/thumbnails/77efaa71a3c5462d855c2e52816e397c-d378b8f5a370449e.gif</thumbnail_url><duration>255.571</duration><title>Refactoring Node to Groups Publishing</title><description>This Loom explains a refactor of published node-to-groups to eliminate inefficient looping around space and resource access checks. The latest implementation first checks available group IDs once, then determines which resource UIDs are already synced and creates resource access only for those that are not synced, using a single upsert outside the loop. It also uses an ensurePartialSpaceAccess function that queries existing space access, marks missing ones as partial if possible, and returns successes while tracking remaining failures to handle publishNodeToGroups in failure mode. The author then validates behavior by clearing existing data and republishing, confirming group membership and space access are created correctly as before after moving ensure space access into the database package.</description></oembed>