Giter Site home page Giter Site logo

Comments (12)

meteorlxy avatar meteorlxy commented on May 28, 2024

建议升级一下版本试一下,然后最好提供一下复现repo,不然光这么说也不好确认是什么问题

from vssue.

Ancientwood avatar Ancientwood commented on May 28, 2024

关于版本我看了 vssue 组件里面代码 onTitleChange onOptionsChange onIssueIdChange 的确都没有再调用 init() 的方法,另 测试 repo:

vuepress - https://github.com/Ancientwood/vssue-test
静态页面 - https://github.com/Ancientwood/vssue-test-blog
访问地址 - http://vssue.ancientwood.club/

然后尴尬的是结果我这个测试的repo并没有复现...(我复制了原来的项目然后删掉了所有文章

然后我测试了有问题的repo,vssue 重复创建的情况只在第52篇post之后...

from vssue.

Ancientwood avatar Ancientwood commented on May 28, 2024

把post全部加回去,开始重复创建了。
https://github.com/Ancientwood/vssue-test/issues

from vssue.

meteorlxy avatar meteorlxy commented on May 28, 2024

是不是无限重复创建。。。如果是的话,我一直没做处理的问题可能暴露了:sweat_smile:

from vssue.

Ancientwood avatar Ancientwood commented on May 28, 2024

是无限重复...

from vssue.

meteorlxy avatar meteorlxy commented on May 28, 2024

这就要说到 Github API 有多么坑爹了……

GitHub 没有提供根据标题查找 issue 的 API,现在的做法是把 issues 列表取下来然后用 js 筛选里面的标题,然后每次取下来的 issues 数量其实有限,现在看来应该是50个……

from vssue.

Ancientwood avatar Ancientwood commented on May 28, 2024

所以用 title 的话就是用 list-issues-for-a-repository 这个 api 遍历
https://developer.github.com/v3/issues/#list-issues-for-a-repository
这个...好像...没有...分页...

而用 issue id 的话就是用 get-a-single-issue
https://developer.github.com/v3/issues/#get-a-single-issue

所以同一个 id 总能找到不会重复创建对吧

from vssue.

meteorlxy avatar meteorlxy commented on May 28, 2024

目前是这样的。我刚去看了一眼 gitment 和 gitalk ,他们居然是用一个单独的 label 当 id 😅

我开发完 vssue 最大的感觉就是 Github 的 API 真的辣鸡……

from vssue.

meteorlxy avatar meteorlxy commented on May 28, 2024

Github 的分页非常不好使 https://developer.github.com/v3/#pagination

from vssue.

Ancientwood avatar Ancientwood commented on May 28, 2024

莫名想到,init的时候创建一个 issue id 为1的 issue,在里面维护所有自动创建了的issue的列表 :(

from vssue.

meteorlxy avatar meteorlxy commented on May 28, 2024

现在想到的解决方案:

  1. 在 GitHub 中像 gitment 和 gitalk 那样用 label 作为 id (#25),但是会导致现在已经在用 Vssue + GitHub 的项目重新生成 issues 或者手动补充上 label,算是某种 breaking changes。

  2. 在文档里写清楚 GitHub 存在这个问题,然后建议用手动给 options 传入 labels 的方式来解决。

from vssue.

meteorlxy avatar meteorlxy commented on May 28, 2024

还是决定不引入 breaking changes 了……于是这个问题其实还是应该挪到主题下面解决,哈哈

from vssue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.