home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where issue = 1726531350 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 1

  • simonw 8

issue 1

  • Datasette should serve Access-Control-Max-Age · 8 ✖

author_association 1

  • OWNER 8
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1563607291 https://github.com/simonw/datasette/issues/2079#issuecomment-1563607291 https://api.github.com/repos/simonw/datasette/issues/2079 IC_kwDOBm6k_c5dMsD7 simonw 9599 2023-05-25T22:56:28Z 2023-05-25T22:56:28Z OWNER

Wrote this up as a TIL: https://til.simonwillison.net/http/testing-cors-max-age

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette should serve Access-Control-Max-Age 1726531350  
1563597589 https://github.com/simonw/datasette/issues/2079#issuecomment-1563597589 https://api.github.com/repos/simonw/datasette/issues/2079 IC_kwDOBm6k_c5dMpsV simonw 9599 2023-05-25T22:42:07Z 2023-05-25T22:42:07Z OWNER

Mystery solved as to why I wasn't seeing this work:

I had "Disable Cache" checked!

I ran this experiment after un-checking that box:

javascript fetch('https://latest.datasette.io/ephemeral/foo/1/-/update', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ test: 'test' }) }); // And run it again fetch('https://latest.datasette.io/ephemeral/foo/1/-/update', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ test: 'test' }) }); // Now try a thing that doesn't serve that max-age header yet: fetch('https://latest-with-plugins.datasette.io/ephemeral/foo/1/-/update', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ test: 'test' }) }); // And a second time but within 5s fetch('https://latest-with-plugins.datasette.io/ephemeral/foo/1/-/update', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ test: 'test' }) }); // Third time after waiting longer than 5s fetch('https://latest-with-plugins.datasette.io/ephemeral/foo/1/-/update', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ test: 'test' }) }); // Try that original one again - still within the 1hr cache time fetch('https://latest.datasette.io/ephemeral/foo/1/-/update', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ test: 'test' }) }); The results show that the cache of 1hr was being obeyed for latest.datasette.io while the latest-with-plugins.datasette.io default cache of 5s was being obeyed too.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette should serve Access-Control-Max-Age 1726531350  
1563588199 https://github.com/simonw/datasette/issues/2079#issuecomment-1563588199 https://api.github.com/repos/simonw/datasette/issues/2079 IC_kwDOBm6k_c5dMnZn simonw 9599 2023-05-25T22:29:47Z 2023-05-25T22:30:12Z OWNER

https://fetch.spec.whatwg.org/#http-access-control-max-age says:

Indicates the number of seconds (5 by default) the information provided by the Access-Control-Allow-Methods and Access-Control-Allow-Headers headers can be cached.

So there was already a 5s cache anyway.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette should serve Access-Control-Max-Age 1726531350  
1563587230 https://github.com/simonw/datasette/issues/2079#issuecomment-1563587230 https://api.github.com/repos/simonw/datasette/issues/2079 IC_kwDOBm6k_c5dMnKe simonw 9599 2023-05-25T22:28:20Z 2023-05-25T22:28:20Z OWNER

Weird... after the deploy went out:

But the request did indeed get the new header:

So I'm not sure why it's making multiple POST requests like that.

Maybe it's because the attempted POST failed with a 404?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette should serve Access-Control-Max-Age 1726531350  
1563565407 https://github.com/simonw/datasette/issues/2079#issuecomment-1563565407 https://api.github.com/repos/simonw/datasette/issues/2079 IC_kwDOBm6k_c5dMh1f simonw 9599 2023-05-25T22:09:53Z 2023-05-25T22:09:53Z OWNER

Updated docs: https://docs.datasette.io/en/latest/json_api.html#enabling-cors

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette should serve Access-Control-Max-Age 1726531350  
1563563438 https://github.com/simonw/datasette/issues/2079#issuecomment-1563563438 https://api.github.com/repos/simonw/datasette/issues/2079 IC_kwDOBm6k_c5dMhWu simonw 9599 2023-05-25T22:08:28Z 2023-05-25T22:08:28Z OWNER

I ran this on https://www.example.com/ twice using the console: javascript fetch( `https://latest.datasette.io/ephemeral/foo/1/-/update`, { method: "POST", mode: "cors", headers: { Authorization: `Bearer tok`, "Content-Type": "application/json", }, body: JSON.stringify({update: {blah: 1}}), } ) .then((r) => r.json()) .then((data) => { console.log(data); }); And got this in the network pane:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette should serve Access-Control-Max-Age 1726531350  
1563558915 https://github.com/simonw/datasette/issues/2079#issuecomment-1563558915 https://api.github.com/repos/simonw/datasette/issues/2079 IC_kwDOBm6k_c5dMgQD simonw 9599 2023-05-25T22:04:41Z 2023-05-25T22:04:41Z OWNER

I'm going with 3600 for 1 hour instead of 600 for 10 minutes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette should serve Access-Control-Max-Age 1726531350  
1563547097 https://github.com/simonw/datasette/issues/2079#issuecomment-1563547097 https://api.github.com/repos/simonw/datasette/issues/2079 IC_kwDOBm6k_c5dMdXZ simonw 9599 2023-05-25T21:51:38Z 2023-05-25T21:51:38Z OWNER

Also need to update this documentation:

https://github.com/simonw/datasette/blob/9584879534ff0556e04e4c420262972884cac87b/docs/json_api.rst?plain=1#L453-L465

Or maybe make that automated via cog.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette should serve Access-Control-Max-Age 1726531350  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 20.478ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows