mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-12 16:47:41 +02:00
postgres: handle unknown types (#3632)
This commit is contained in:
parent
95753de85d
commit
3fec00f2a8
2 changed files with 97 additions and 52 deletions
|
@ -163,6 +163,24 @@ func TestBackend(t *testing.T) {
|
|||
assert.NoError(t, stream.Err())
|
||||
})
|
||||
|
||||
t.Run("unknown type", func(t *testing.T) {
|
||||
_, err := backend.pool.Exec(ctx, `
|
||||
INSERT INTO `+schemaName+"."+recordsTableName+` (type, id, version, data)
|
||||
VALUES ('unknown', '1', 1000, '{"@type":"UNKNOWN","value":{}}')
|
||||
`)
|
||||
assert.NoError(t, err)
|
||||
|
||||
_, err = backend.Get(ctx, "unknown", "1")
|
||||
assert.ErrorIs(t, err, storage.ErrNotFound)
|
||||
|
||||
_, _, stream, err := backend.SyncLatest(ctx, "unknown-test", nil)
|
||||
if assert.NoError(t, err) {
|
||||
_, err := storage.RecordStreamToList(stream)
|
||||
assert.NoError(t, err)
|
||||
stream.Close()
|
||||
}
|
||||
})
|
||||
|
||||
return nil
|
||||
}))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue