Skip unchanged canonical abstracts when attaching evidence
Metadata integrity checks / metadata (push) Successful in 2h6m32s

This commit is contained in:
2026-11-25 18:51:50 +08:00
parent 7b684e8d4a
commit 207265345d
2 changed files with 27 additions and 1 deletions
+22
View File
@@ -56,6 +56,28 @@ class SubmissionTests(unittest.TestCase):
self.decision(paper,two,'forum2',[('openreview','forum2'),('iclr_number','2')])
self.assertEqual(self.store.conn.execute('SELECT count(*) FROM submissions').fetchone()[0],2)
def test_new_source_only_updates_canonical_abstract_when_it_changes(self):
conn = self.store.conn
conn.execute("""CREATE TRIGGER reject_noop_abstract_update BEFORE UPDATE OF abstract ON papers
WHEN OLD.abstract IS NEW.abstract
BEGIN SELECT RAISE(ABORT, 'unchanged abstract written'); END""")
title = 'An indexed work with several independent records'
ids = {'arxiv': '2601.00002'}
paper, _ = self.store.record('index', 'initial', 'https://example.org/initial', title, None, [], ids)
for name, incoming, expected in (
('missing', None, None),
('empty', '', ''),
('another-empty', '', ''),
('missing-again', None, None),
('publication', 'Canonical abstract', 'Canonical abstract'),
('conference', 'Conference abstract', 'Canonical abstract'),
):
with self.subTest(source=name):
linked, record = self.store.record(name, name, 'https://example.org/'+name, title, incoming, [], ids)
self.assertEqual(linked, paper)
self.assertEqual(conn.execute('SELECT abstract FROM papers WHERE id=?', (paper,)).fetchone(), (expected,))
self.assertEqual(conn.execute('SELECT abstract FROM source_records WHERE id=?', (record,)).fetchone(), (incoming,))
def test_conflicting_forums_cannot_be_bridged_by_one_submission_number(self):
paper,one=self.record('snapshot','realForum',['Jane Doe'])
other,two=self.record('snapshot','differentForum',['Other Author'])