<p></p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gravitystorm/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gravitystorm">@gravitystorm</a> how would the concept of <strong>closing/reopening notes</strong> work with this new data model?</p>
<p dir="auto">One way would be…</p>
<ul dir="auto">
<li><code class="notranslate">Notes</code> has a field <code class="notranslate">open=true (default)</code></li>
<li><code class="notranslate">NoteComments</code> have a field <code class="notranslate">action=null (default)|close|reopen</code></li>
<li>Whenever a comment is saved, a hook is triggered that updates the <code class="notranslate">Notes.open</code> flag.
<ul dir="auto">
<li>Should this update be done in a Transaction to guard against edge cases where the async update fails?</li>
</ul>
</li>
</ul>
<p dir="auto">In addition, we could use the same mechanism to denormalize <code class="notranslate">lastOpened_by</code> and <code class="notranslate">lastClosed_by</code> flags on the <code class="notranslate">Notes</code>. However whoever will work on this should decide based on performance considerations if this is needed vor the UI or API output.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/3831#issuecomment-1748010807">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLNOIM5XYSGCO3XODLTX5YY2FAVCNFSM6AAAAAASXEX646VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBYGAYTAOBQG4">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLKBPTOIPFYXMWTOI43X5YY2FA5CNFSM6AAAAAASXEX646WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTIGCDTO.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/3831/1748010807</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/3831#issuecomment-1748010807",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/3831#issuecomment-1748010807",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>