text:
TODO: Fix remaining crashes

Related: #1, #5, #6

I've noticed Hoth Battle is very prone to crashing after going from first area to second in story. Not sure if spending time blasting every metal wall has to do anything with it.


text:
No such variable: "g:vundle_lazy_load"

vundle#end tries to unlet g:vundle_lazy_load
for reasons I can't explain I kept getting
Error detected while processing function vundle#end:
line    1:
E108: No such variable: "g:vundle_lazy_load

whenever I opened a file.
The following fixes it.
func! vundle#end(...) abort
  if (exists("g:vundle_lazy_load"))
    unlet g:vundle_lazy_load
  endif
  call vundle#config#activate_bundles()
endf

You should user #end only if you have used #begin, otherwise you are wasting time doing expensive rtp manipulation twice. That said, with recent changes, you no longer need that patch, even you chose you mix #rc and #end, which you shouldn't do anyway.

source: gharchive/issue

authors: jdevera masukomi

license: mit

license_type: permissive

license_source: bigquery


text:
Support Chrome

In Chrome, the drawing-position is offset from the cursor position. This PR fixes this and includes two small improvements:

Fix cursor position in Google Chrome
Use new Array(..) for initializing empty arrays.
Use crosshair cursor for the Canvas

Looks good to me. Thanks!

Not exactly sure how the gh-pages branch works, but it would probably be useful to also push this change there for the demo version.

You can totally do that, just fetch and checkout the gh-pages branch, make the changes then when doing your pull request, make sure to specify gh-pages as the branch that the PR applies to.

source: gharchive/pull-request

authors: gmarty sharkdp

repo: gmarty/hough-transform-js


text:
prueba js final final

DESCRIPTION
Nombre:
Usuario Platzi:
Reto:

[x] Primer problema
[x] Segundo problema
[x] Tercer problema

as

repo: gndx/javascript-challenges

license: MIT

license_source: github-api


text:
🛑 i 學園 is down

In 859e370, i 學園 (https://istudy.ntut.edu.tw/mooc/index.php) was down:

HTTP code: 0
Response time: 0 ms

Resolved: i 學園 is back up in e40ef7a.

repo: gnehs/ntut-uptime


text:
Dependency on package tk

When I installed the package I noticed that it depends on tk.  I'm guessing that it was intended to be depending on tkinter instead.
Since tkinter is part of the Python standard library I would propose to delete the dependency.
For reference: the description of the project tk on pypi is "TensorKit is a deep learning helper between Python and C++." (tk on pypi.org).

Good catch. I think I clearly mixed mixed something up when writing the setup.py. I will fix it in the next release.

@marnikow This should hopefully have been fixed now in v1.3.0

authors: gnikit marnikow

repo: gnikit/tkinter-tooltip


text:
Release 3.21.0

Features

[EPIC] Feature discoverability - Beamer (#3515)
Feat: display threshold in the Safe header (#3604)

Fixes & improvements

fix: clarify nonce warning (#3617)
fix: enable detected wallet (#3612)
fix: Set safeTxGas to 0 when rejecting a tx (#3605)
fix: Only fetch fee history on safe creation if EIP-1559 supported on network (#3593)
Update safe-core-sdk version (#3598)

Pull Request Test Coverage Report for Build 1929276733

21 of 141 (14.89%)  changed or added relevant lines in 18 files are covered.
17 unchanged lines in 5 files lost coverage.
Overall coverage decreased (-0.4%) to 34.89%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

src/logic/cookies/store/selectors/index.ts
0
1
0.0%

src/components/List/index.tsx
0
2
0.0%

src/logic/cookies/store/reducer/cookies.ts
1
3
33.33%

src/logic/cookies/utils/index.ts
4
7
57.14%

src/utils/googleAnalytics.ts
4
7
57.14%

src/utils/storage/Storage.ts
1
4
25.0%

src/components/AppLayout/Sidebar/Threshold/index.tsx
0
5
0.0%

src/utils/intercom.ts
0
5
0.0%

src/components/AppLayout/Sidebar/index.tsx
0
11
0.0%

src/utils/beamer.ts
0
27
0.0%

Files with Coverage Reduction
New Missed Lines
%

src/components/AppLayout/Footer/index.tsx
1
90.91%

src/components/CookiesBanner/index.tsx
3
0%

src/utils/intercom.ts
3
0%

src/components/AppLayout/Sidebar/index.tsx
4
0%

src/logic/hooks/useSafeAppUrl.tsx
6
0%

Totals

Change from base Build 1916080605:
-0.4%

Covered Lines:
3366

Relevant Lines:
8719

💛  - Coveralls

Something curios that doesn't happen in prod. Check the left sidebar.

Besides those 2 minor things I thing the release branch looks good

The Safe Mobile showing up in the least should be fixed by enabling this wallet on all chains.

authors: coveralls francovenica katspaugh

repo: gnosis/safe-react


text:
Link with notification service

Story
As a user of the relay service, I would like it to be able of sending notifications.
Background

Currently there's no way of sending notifications to users from the relay service
Notification service could be connected to relay service to achieve that

Acceptance criteria

Relay service can send custom notifications to users of the relay serviasdasdasdasdasdasd

Open questions

Implemented in e29b2afbe1ec3553b171cbe1e04f05f97f0e8444

repo: gnosis/safe-relay-service


text:
🛑 Forkmon ETH2 is down

In ff8e050, Forkmon ETH2 (https://eth2-forkmon.chiadochain.net/) was down:

HTTP code: 502
Response time: 201 ms

Resolved: Forkmon ETH2 is back up in e16e3f7 after 27 minutes.

repo: gnosischain/chiado-uptime


text:
mark importShadow with opinionated tag

Add "opinionated" tag to the importShadowChecker info object.

Fixed.

repo: go-critic/checkers


text:
Provide stable Riot API

Provide stable Riot API.

Api basic transformation completed, it will be gradually stabilized after the completion of the disk version and stable in 1.0.

@vcaesar Is there any documentation on this API functionality? Or how I would use this outside of Go.

Please see the documentation and examples. Other languages can call the grpc interface.

authors: cboothe vcaesar

repo: go-ego/riot


text:
Can't build with docker (manifest unknown)

goflutter/hover:v0.41.6 hover-safe.sh build linux --skip-flutter-build-bundle --skip-engine-download
docker container: Unable to find image 'goflutter/hover:v0.41.6' locally
docker container: /usr/bin/docker: Error response from daemon: manifest for goflutter/hover:v0.41.6 not found: manifest unknown: manifest unknown.
docker container: See '/usr/bin/docker run --help'.
hover: Docker run failed: exit status 125

We had an issue with the docker image so that some hover versions are not available as docker images. We need to release a new version of hover to fix it @GeertJohan.
As temporary fix you can clone hover and install it locally. Then it pulls the latest docker image which works again.

v0.42.0 has been released. It will take some minutes to build the docker image, but when you try in about an hour or so it should already be available

repo: go-flutter-desktop/go-flutter


text:
suggest add reviewers status bar on PR page like github

Gitea version (or commit ref):
Git version:
Operating system:
Database (use [x]):

[ ] PostgreSQL
[ ] MySQL
[ ] MSSQL
[ ] SQLite

Can you reproduce the bug at https://try.gitea.io:

[ ] Yes (provide example URL)
[ ] No
[ ] Not relevant

Log gist:

Description
hello , I think  that the reviewers status bar in github is usefull for  the review flow , It provide a way to request review from other people (I think it's different from Assignees , the Assignees means people who can chage this PR as author), and provide a clear summary for people who aprove and who request chages. I hope this feature can be realized on gitea. thanks.
Screenshots

@a1012112796 which milestone you'd like to see this feature?

repo: go-gitea/gitea


text:
App crash on startup for new install on tablet

Just installed the app on my tablet and it crashes. Emailed stack trace report and was advised by Arif to open issue here.

Gitea version (or commit ref): 3.1.0-rc2
Operating system: Android 9
Can you reproduce the bug at https://try.gitea.io:

[ ] Yes (provide example URL)
[ ] No
[X ] Not relevant

We will need the error logs and Gitea version.
The version you provided isn't for Gitea.
You mentioned Arif, so perhaps that's your Gitnex version?

Apologies, I have created this on the wrong project. I will close.

authors: jolheiser zahidhanif


text:
Panic while enrolling in MFA

Gitea version (or commit ref): 1.13.0
Git version: 2.25.1
Operating system: Ubuntu 20.04

Install Mode: From Binary
Run command: gitea web -c /etc/gitea/app.ini WORK_DIRECTORY=/var/lib/gitea

Database (use [x]):

[x] PostgreSQL
[ ] MySQL
[ ] MSSQL
[ ] SQLite

Can you reproduce the bug at https://try.gitea.io:

[ ] Yes (provide example URL)
[x] No

Log gist:

Started POST /user/settings/security/two_factor/enroll for 127.0.0.1
2020/12/24 18:18:36 ...les/context/panic.go:35:1() [E] PANIC:: interface conversion: interface {} is nil, not string
	/usr/local/go/src/runtime/iface.go:261 (0x41358e)
	/go/src/code.gitea.io/gitea/routers/user/setting/security_twofa.go:192 (0x1d87cfe)
	/usr/local/go/src/reflect/value.go:476 (0x4a5886)
	/usr/local/go/src/reflect/value.go:337 (0x4a4d78)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0xd819f9)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:137 (0xd813ca)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd82f1c)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x1665df4)
	/go/src/code.gitea.io/gitea/modules/context/panic.go:39 (0x1665de5)
	/usr/local/go/src/reflect/value.go:476 (0x4a5886)
	/usr/local/go/src/reflect/value.go:337 (0x4a4d78)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0xd819f9)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:137 (0xd813ca)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd82f1c)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x1619ac4)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/session/session.go:192 (0x1619aad)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0xd82d92)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd81714)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd814b9)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd82f1c)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0xd94aa5)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/recovery.go:161 (0xd94a98)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/logger.go:40 (0xd86ad7)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd81714)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd814b9)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd82f1c)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x21aa7c4)
	/go/src/code.gitea.io/gitea/routers/routes/routes.go:109 (0x21aa7ae)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0xd82d92)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd81714)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd814b9)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd82f1c)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:187 (0xd95cf0)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:294 (0xd8f52f)
	/go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/macaron.go:218 (0xd87e4d)
	/go/src/code.gitea.io/gitea/vendor/github.com/gorilla/context/context.go:141 (0x128ed93)
	/usr/local/go/src/net/http/server.go:2042 (0x777623)
	/usr/local/go/src/net/http/server.go:2843 (0x77ac22)
	/usr/local/go/src/net/http/server.go:1925 (0x77642c)
	/usr/local/go/src/runtime/asm_amd64.s:1374 (0x478820)

2020/12/24 18:18:36 Completed POST /user/settings/security/two_factor/enroll 500 Internal Server Error in 10.84602ms

Description
When attempting to enroll in MFA in a fresh install of Gitea, an HTTP 500 error is shown and the above log is emitted.
This appears to be #13149, however that was resolved on it's own. Since it's no longer isolated I figured I should post again.
Edit: This is using the Authy app for TOTP.

Could you find the log before these like Unable to save changes to the session: ?

The panic is occuring here:
https://github.com/go-gitea/gitea/blob/d551152582028b1e42d663cf1bc1e9a3a7e38b1e/routers/user/setting/security_twofa.go#L192
The error implies that ctx.Session.Get("twofaSecret") returns nil not a string.
Why might this occur?
Well it shouldn't be possible to get to this page without that twofaSecret being set within the session as it will be set in twofaGenerateSecretAndQr unless there is a log.Error("Unable to save changes to the session: %v", err)
So as @lunny suggests, could you check the preceding logs for a Unable to save changes to the session: line? That would help us to find out where the issue is.
If there is not a log line like that then we need to think again but we can't proceed further without knowing if that occurs.

Apologies for the delay, Christmas and all.
I searched the log and found the error log as I had sent originally, but there was no line containing Unable to save changes to session.
Frustratingly, after coming back to it today I was able to add the factor successfully. Unfortunately nothing really changed, I started the server under the same conditions as before (in the foreground via CLI) after it had been running since as a system service (same as before).
I will close this as I can't reproduce this, and thank you for helping thus far. I will re-open if I manage to encounter it again with a full log.

I just hit this issue also with 1.13.1.  For me, the issue only occurs when PROTOCOL = https is set within the app.ini file as when I switch back to PROTOCOL = http I don't see the error.

I just hit this issue also with 1.13.1.  For me, the issue only occurs when PROTOCOL = https is set within the app.ini file as when I switch back to PROTOCOL = http I don't see the error.

@ashmckenzie we need the logs if we're going to progress this at all as stated https://github.com/go-gitea/gitea/issues/14144#issuecomment-751396178

@ashmckenzie we need the logs if we're going to progress this at all as stated https://github.com/go-gitea/gitea/issues/14144#issuecomment-751396178

@zeripath this is what I see in the logs with debugging enabled:
2021/01/18 12:03:29 ...s/context/context.go:332:func1() [D] Session ID: <removed>
2021/01/18 12:03:29 ...s/context/context.go:333:func1() [D] CSRF Token: <removed>
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x166b1d4)
        /go/src/code.gitea.io/gitea/modules/context/panic.go:39 (0x166b1c5)
        /usr/local/go/src/reflect/value.go:476 (0x4a4e26)
        /usr/local/go/src/reflect/value.go:337 (0x4a4318)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0xd86739)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:137 (0xd8610a)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd87c5c)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x161eea4)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/session/session.go:192 (0x161ee8d)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0xd87ad2)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd86454)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd861f9)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd87c5c)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0xd997e5)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/recovery.go:161 (0xd997d8)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/logger.go:40 (0xd8b817)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd86454)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd861f9)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd87c5c)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x21b0f24)
        /go/src/code.gitea.io/gitea/routers/routes/routes.go:109 (0x21b0f0e)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0xd87ad2)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd86454)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd861f9)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd87c5c)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:187 (0xd9aa30)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:294 (0xd9426f)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/macaron.go:218 (0xd8cb8d)
        /go/src/code.gitea.io/gitea/vendor/github.com/gorilla/context/context.go:141 (0x1293fd3)
        /usr/local/go/src/net/http/server.go:2042 (0x77b883)
        /usr/local/go/src/net/http/server.go:2843 (0x77ee82)
        /usr/local/go/src/net/http/server.go:1925 (0x77a68c)
        /usr/local/go/src/runtime/asm_amd64.s:1374 (0x477dc0)

2021/01/18 12:03:29 ...s/context/context.go:139:HTML() [D] Template: status/500
2021/01/18 12:03:29 Completed POST /user/settings/security/two_factor/enroll 500 Internal Server Error in 7.260135ms

After a bit of trial and error, I discovered when https://addons.mozilla.org/en-US/firefox/addon/malwarebytes/ is installed and the 'Scams' toggle is enabled, this results in the 500 being produced:

When I disable the 'Scams' toggle, everything works as expected.

So as @lunny suggests, could you check the preceding logs for a Unable to save changes to the session: line? That would help us to find out where the issue is.

I don't see anything in the logs saying Unable to save changes to the session:

@zeripath this is what I see in the logs with debugging enabled:
2021/01/18 12:03:29 ...s/context/context.go:332:func1() [D] Session ID: <removed>
2021/01/18 12:03:29 ...s/context/context.go:333:func1() [D] CSRF Token: <removed>
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x166b1d4)
        /go/src/code.gitea.io/gitea/modules/context/panic.go:39 (0x166b1c5)
        /usr/local/go/src/reflect/value.go:476 (0x4a4e26)
        /usr/local/go/src/reflect/value.go:337 (0x4a4318)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0xd86739)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:137 (0xd8610a)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd87c5c)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x161eea4)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/session/session.go:192 (0x161ee8d)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0xd87ad2)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd86454)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd861f9)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd87c5c)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0xd997e5)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/recovery.go:161 (0xd997d8)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/logger.go:40 (0xd8b817)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd86454)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd861f9)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd87c5c)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x21b0f24)
        /go/src/code.gitea.io/gitea/routers/routes/routes.go:109 (0x21b0f0e)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0xd87ad2)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd86454)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd861f9)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd87c5c)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:187 (0xd9aa30)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:294 (0xd9426f)
        /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/macaron.go:218 (0xd8cb8d)
        /go/src/code.gitea.io/gitea/vendor/github.com/gorilla/context/context.go:141 (0x1293fd3)
        /usr/local/go/src/net/http/server.go:2042 (0x77b883)
        /usr/local/go/src/net/http/server.go:2843 (0x77ee82)
        /usr/local/go/src/net/http/server.go:1925 (0x77a68c)
        /usr/local/go/src/runtime/asm_amd64.s:1374 (0x477dc0)

2021/01/18 12:03:29 ...s/context/context.go:139:HTML() [D] Template: status/500
2021/01/18 12:03:29 Completed POST /user/settings/security/two_factor/enroll 500 Internal Server Error in 7.260135ms

After a bit of trial and error, I discovered when https://addons.mozilla.org/en-US/firefox/addon/malwarebytes/ is installed and the 'Scams' toggle is enabled, this results in the 500 being produced:

When I disable the 'Scams' toggle, everything works as expected.

So as @lunny suggests, could you check the preceding logs for a Unable to save changes to the session: line? That would help us to find out where the issue is.

I don't see anything in the logs saying Unable to save changes to the session:

I clone this repo, checkout out v1.13.1 and was able to replicate:
2021/01/18 12:34:17 Started POST /user/settings/security/two_factor/enroll for 127.0.0.1
2021/01/18 12:34:17 ...s/context/context.go:332:func1() [D] Session ID: e6a55fa994ded52b
2021/01/18 12:34:17 ...s/context/context.go:333:func1() [D] CSRF Token: TP4vwFjSw2rIdrB5aTkbaODmWYM6MTYxMDkzMzY1MDEzNTczMTAwMA
2021/01/18 12:34:17 ...les/context/panic.go:35:1() [E] PANIC:: interface conversion: interface {} is nil, not string
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/runtime/iface.go:261 (0x400ff0e)
		panicdottypeE: panic(&TypeAssertionError{iface, have, want, ""})
	/Users/ash/src/personal/external/gitea/routers/user/setting/security_twofa.go:192 (0x5989e1e)
		EnrollTwoFactorPost: secret := ctx.Session.Get("twofaSecret").(string)
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/reflect/value.go:476 (0x40a1746)
		Value.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/reflect/value.go:337 (0x40a0c38)
		Value.Call: return v.call("Call", in)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0x49831d9)
		(*injector).callInvoke: return reflect.ValueOf(f).Call(in), nil
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:137 (0x4982baa)
		(*injector).Invoke: return inj.callInvoke(f, t, t.NumIn())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x49846fc)
		(*Context).run: vals, err := c.Invoke(c.handler())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x5267af4)
		(*Context).Next: c.run()
	/Users/ash/src/personal/external/gitea/modules/context/panic.go:39 (0x5267ae5)
		Recovery.func1: ctx.Next()
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/reflect/value.go:476 (0x40a1746)
		Value.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/reflect/value.go:337 (0x40a0c38)
		Value.Call: return v.call("Call", in)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0x49831d9)
		(*injector).callInvoke: return reflect.ValueOf(f).Call(in), nil
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:137 (0x4982baa)
		(*injector).Invoke: return inj.callInvoke(f, t, t.NumIn())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x49846fc)
		(*Context).run: vals, err := c.Invoke(c.handler())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x521b7c4)
		(*Context).Next: c.run()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/session/session.go:192 (0x521b7ad)
		Sessioner.func1: ctx.Next()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0x4984572)
		ContextInvoker.Invoke: invoke(params[0].(*Context))
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0x4982ef4)
		(*injector).fastInvoke: return f.Invoke(in)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0x4982c99)
		(*injector).Invoke: return inj.fastInvoke(v, t, t.NumIn())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x49846fc)
		(*Context).run: vals, err := c.Invoke(c.handler())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x4996285)
		(*Context).Next: c.run()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/recovery.go:161 (0x4996278)
		Recovery.func1: c.Next()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/logger.go:40 (0x49882b7)
		LoggerInvoker.Invoke: invoke(params[0].(*Context), params[1].(*log.Logger))
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0x4982ef4)
		(*injector).fastInvoke: return f.Invoke(in)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0x4982c99)
		(*injector).Invoke: return inj.fastInvoke(v, t, t.NumIn())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x49846fc)
		(*Context).run: vals, err := c.Invoke(c.handler())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x5dad724)
		(*Context).Next: c.run()
	/Users/ash/src/personal/external/gitea/routers/routes/routes.go:109 (0x5dad70e)
		RouterHandler.func1: ctx.Next()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0x4984572)
		ContextInvoker.Invoke: invoke(params[0].(*Context))
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0x4982ef4)
		(*injector).fastInvoke: return f.Invoke(in)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0x4982c99)
		(*injector).Invoke: return inj.fastInvoke(v, t, t.NumIn())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x49846fc)
		(*Context).run: vals, err := c.Invoke(c.handler())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/router.go:187 (0x49974d0)
		(*Router).Handle.func1: c.run()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/router.go:294 (0x4990d0f)
		(*Router).ServeHTTP: leaf.handle(rw, req, nil)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/macaron.go:218 (0x498962d)
		(*Macaron).ServeHTTP: m.Router.ServeHTTP(rw, req)
	/Users/ash/src/personal/external/gitea/vendor/github.com/gorilla/context/context.go:141 (0x4e90a73)
		ClearHandler.func1: h.ServeHTTP(w, r)
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/net/http/server.go:2042 (0x43784a3)
		HandlerFunc.ServeHTTP: f(w, r)
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/net/http/server.go:2843 (0x437baa2)
		serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/net/http/server.go:1925 (0x43772ac)
		(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/runtime/asm_amd64.s:1374 (0x4074800)
		goexit: BYTE	$0x90	// NOP

2021/01/18 12:34:17 ...s/context/context.go:139:HTML() [D] Template: status/500
2021/01/18 12:34:17 Completed POST /user/settings/security/two_factor/enroll 500 Internal Server Error in 18.599542ms

I clone this repo, checkout out v1.13.1 and was able to replicate:
2021/01/18 12:34:17 Started POST /user/settings/security/two_factor/enroll for 127.0.0.1
2021/01/18 12:34:17 ...s/context/context.go:332:func1() [D] Session ID: e6a55fa994ded52b
2021/01/18 12:34:17 ...s/context/context.go:333:func1() [D] CSRF Token: TP4vwFjSw2rIdrB5aTkbaODmWYM6MTYxMDkzMzY1MDEzNTczMTAwMA
2021/01/18 12:34:17 ...les/context/panic.go:35:1() [E] PANIC:: interface conversion: interface {} is nil, not string
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/runtime/iface.go:261 (0x400ff0e)
		panicdottypeE: panic(&TypeAssertionError{iface, have, want, ""})
	/Users/ash/src/personal/external/gitea/routers/user/setting/security_twofa.go:192 (0x5989e1e)
		EnrollTwoFactorPost: secret := ctx.Session.Get("twofaSecret").(string)
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/reflect/value.go:476 (0x40a1746)
		Value.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/reflect/value.go:337 (0x40a0c38)
		Value.Call: return v.call("Call", in)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0x49831d9)
		(*injector).callInvoke: return reflect.ValueOf(f).Call(in), nil
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:137 (0x4982baa)
		(*injector).Invoke: return inj.callInvoke(f, t, t.NumIn())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x49846fc)
		(*Context).run: vals, err := c.Invoke(c.handler())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x5267af4)
		(*Context).Next: c.run()
	/Users/ash/src/personal/external/gitea/modules/context/panic.go:39 (0x5267ae5)
		Recovery.func1: ctx.Next()
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/reflect/value.go:476 (0x40a1746)
		Value.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/reflect/value.go:337 (0x40a0c38)
		Value.Call: return v.call("Call", in)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0x49831d9)
		(*injector).callInvoke: return reflect.ValueOf(f).Call(in), nil
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:137 (0x4982baa)
		(*injector).Invoke: return inj.callInvoke(f, t, t.NumIn())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x49846fc)
		(*Context).run: vals, err := c.Invoke(c.handler())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x521b7c4)
		(*Context).Next: c.run()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/session/session.go:192 (0x521b7ad)
		Sessioner.func1: ctx.Next()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0x4984572)
		ContextInvoker.Invoke: invoke(params[0].(*Context))
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0x4982ef4)
		(*injector).fastInvoke: return f.Invoke(in)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0x4982c99)
		(*injector).Invoke: return inj.fastInvoke(v, t, t.NumIn())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x49846fc)
		(*Context).run: vals, err := c.Invoke(c.handler())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x4996285)
		(*Context).Next: c.run()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/recovery.go:161 (0x4996278)
		Recovery.func1: c.Next()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/logger.go:40 (0x49882b7)
		LoggerInvoker.Invoke: invoke(params[0].(*Context), params[1].(*log.Logger))
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0x4982ef4)
		(*injector).fastInvoke: return f.Invoke(in)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0x4982c99)
		(*injector).Invoke: return inj.fastInvoke(v, t, t.NumIn())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x49846fc)
		(*Context).run: vals, err := c.Invoke(c.handler())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x5dad724)
		(*Context).Next: c.run()
	/Users/ash/src/personal/external/gitea/routers/routes/routes.go:109 (0x5dad70e)
		RouterHandler.func1: ctx.Next()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0x4984572)
		ContextInvoker.Invoke: invoke(params[0].(*Context))
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0x4982ef4)
		(*injector).fastInvoke: return f.Invoke(in)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0x4982c99)
		(*injector).Invoke: return inj.fastInvoke(v, t, t.NumIn())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x49846fc)
		(*Context).run: vals, err := c.Invoke(c.handler())
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/router.go:187 (0x49974d0)
		(*Router).Handle.func1: c.run()
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/router.go:294 (0x4990d0f)
		(*Router).ServeHTTP: leaf.handle(rw, req, nil)
	/Users/ash/src/personal/external/gitea/vendor/gitea.com/macaron/macaron/macaron.go:218 (0x498962d)
		(*Macaron).ServeHTTP: m.Router.ServeHTTP(rw, req)
	/Users/ash/src/personal/external/gitea/vendor/github.com/gorilla/context/context.go:141 (0x4e90a73)
		ClearHandler.func1: h.ServeHTTP(w, r)
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/net/http/server.go:2042 (0x43784a3)
		HandlerFunc.ServeHTTP: f(w, r)
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/net/http/server.go:2843 (0x437baa2)
		serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/net/http/server.go:1925 (0x43772ac)
		(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
	/Users/ash/.asdf/installs/golang/1.15.5/go/src/runtime/asm_amd64.s:1374 (0x4074800)
		goexit: BYTE	$0x90	// NOP

2021/01/18 12:34:17 ...s/context/context.go:139:HTML() [D] Template: status/500
2021/01/18 12:34:17 Completed POST /user/settings/security/two_factor/enroll 500 Internal Server Error in 18.599542ms

I missed the malwarebytes thing - Is there anyway we can not fall foul of this?

I missed the malwarebytes thing - Is there anyway we can not fall foul of this?

authors: ashmckenzie dabaer lunny zeripath


text:
Add option to delete repo if it is broken

If a repo is broken somehow. you will just see a 500 page without the option to delete it.
you can manually add /settings to go to repo settlings page to delete it, but most people don't know.
So I propose a button to directly delete it.

How do you break a repo in the first place?
I support your request, but I definitely wonder what you have to do to achieve that…

https://fosstodon.org/@5am/106979181347005295
It should not hapen ... but there is real world

Where should the link be put to, is there any recommended page/location?

You can delete it from admin panel currently.

Closed in #17747.

authors: 6543 delvh lunny wxiaoguang


text:
Error when upgrading from 1.5.3 pq: column "id" of relation "issue_dependency" already exists

Gitea version (or commit ref): 1.5.3
Git version: 2.17.1
Operating system: Ubuntu 18.04.2
Database (use [x]):

[x] PostgreSQL
[ ] MySQL
[ ] MSSQL
[ ] SQLite

Can you reproduce the bug at https://try.gitea.io:

[ ] Yes (provide example URL)
[ ] No
[x] Not relevant

Log gist:

2019/02/11 14:40:53 [I] Migration: add issue_dependencies
2019/02/11 14:40:53 [...itea/routers/init.go:61 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Error creating issue_dependency_table column definition: pq: column "id" of relation "issue_dependency" already exists

Description
When upgrading from 1.5.3 to 1.6.4 or 1.7.1 I'm getting the abovementioned error.
I tried dropping the "issue_dependency" table but this doesn't help.
gitea=# select * from version;
 id | version
----+---------
  1 |      70

Screenshots

Any ideas, anyone...?

Ok so you're having trouble in this migration file https://github.com/go-gitea/gitea/blob/master/models/migrations/v70.go
I suspect that although you say you have dropped the table you haven't removed the primary key index. You need to drop that aswell. Then the migration should run.

Thanks for your advice, but it still doesn't work. I do not get why it complains about an already existing column, even though the corresponding table has been dropped before?!
gitea=# select * from pg_indexes where tablename = 'issue_dependency';
 schemaname |    tablename     |       indexname       | tablespace |                                       indexdef
------------+------------------+-----------------------+------------+--------------------------------------------------------------------------------------
 gitea      | issue_dependency | issue_dependency_pkey |            | CREATE UNIQUE INDEX issue_dependency_pkey ON gitea.issue_dependency USING btree (id)
(1 row)

gitea=# alter table issue_dependency drop constraint issue_dependency_pkey;
ALTER TABLE
gitea=# select * from pg_indexes where tablename = 'issue_dependency';
 schemaname | tablename | indexname | tablespace | indexdef
------------+-----------+-----------+------------+----------
(0 rows)

gitea=# drop table issue_dependency;
DROP TABLE

DROP INDEX issue_dependency_pkey

Sorry, but that doesn't work...
gitea=# drop index issue_dependency_pkey;
ERROR:  cannot drop index issue_dependency_pkey because constraint issue_dependency_pkey on table issue_dependency requires it
HINT:  You can drop constraint issue_dependency_pkey on table issue_dependency instead.
gitea=# alter table issue_dependency drop constraint issue_dependency_pkey;
ALTER TABLE
gitea=# drop index issue_dependency_pkey;
ERROR:  index "issue_dependency_pkey" does not exist
gitea=# drop table issue_dependency;
DROP TABLE

Try dropping the index after the table has been dropped...

gitea=# drop table issue_dependency;
DROP TABLE

gitea=# DROP INDEX issue_dependency_pkey;
ERROR:  index "issue_dependency_pkey" does not exist

sigh
Right so it appears that somehow you're ending up with the dependency table being created earlier than migration v70 is expecting.
There are two options:

Can you build a gitea? If so you could hack around sections of https://github.com/go-gitea/gitea/blob/master/models/migrations/v70.go removing the issue dependency table section.

That is to be completely explict remove lines: https://github.com/go-gitea/gitea/blob/6cb127d4973da26e351605ebeac0717aed036177/models/migrations/v70.go#L18-L31

A slightly easier but probably less optimal option is just to set the version marker in your database to 70.

UPDATE version SET version = '70';

(I think that's the right SQL)

authors: rawbertp zeripath


text:
Fix attachment manager in release edit page

As title

This doesn't belong in view mode. It should be present on edit screen below or above dropdown for new files.
Once that is done confirmation won't be necessary anymore and the page should not reload, but remove files on form submit (so that changes to title/description can be made along with removal and addition of new files).

@CirnoT  Now I use the same logic as what is used in issues and comments. How about this change? Thanks.

@a1012112796 Why is this still draft?

Noticed the dropzone stuff is like a 90% duplicate of the other dropzone initialization we do at https://github.com/go-gitea/gitea/blob/aaff47ad75e167838a886126ddba0ad8f6f1d073/web_src/js/index.js#L905
I think instead of duplicating the code, it'd be better to consolidate to one function that does the full initialization and if there are any differences, take them as arguments to that function. Possibly move that new function to features/dropzone.js and export from there.

authors: CirnoT a1012112796 silverwind


text:
Add dismiss review feature

It's same with github
refs:
https://github.blog/2016-10-12-dismissing-reviews-on-pull-requests/
https://developer.github.com/v3/pulls/reviews/#dismiss-a-review-for-a-pull-request

Codecov Report

Merging #12674 into master will decrease coverage by 0.02%.
The diff coverage is 51.75%.

@@            Coverage Diff             @@
##           master   #12674      +/-   ##
==========================================
- Coverage   43.32%   43.29%   -0.03%
==========================================
  Files         646      647       +1
  Lines       71592    71699     +107
==========================================
+ Hits        31015    31044      +29
- Misses      35565    35621      +56
- Partials     5012     5034      +22

Impacted Files
Coverage Δ

models/branches.go
42.70% <0.00%> (-0.31%)
:arrow_down:

models/issue_comment.go
53.75% <ø> (ø)

models/migrations/migrations.go
4.66% <ø> (ø)

models/migrations/v148.go
0.00% <0.00%> (ø)

models/pull.go
55.17% <0.00%> (ø)

modules/auth/repo_form.go
42.34% <ø> (ø)

modules/templates/helper.go
46.20% <0.00%> (-0.20%)
:arrow_down:

routers/repo/pull_review.go
0.00% <0.00%> (ø)

routers/api/v1/repo/pull_review.go
34.29% <22.72%> (-1.38%)
:arrow_down:

modules/notification/mail/mail.go
34.44% <33.33%> (-3.49%)
:arrow_down:

... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3270e7a...365fc83. Read the comment docs.

In my case clicking dismiss review button (green X) doesn't dismiss requested review, but instead going back to top of PR page.

@a1012112796 dismiss worked as expected

Please resolve conflicts

Codecov Report

Merging #12674 (46cbcc2) into master (1bb5c09) will increase coverage by 0.02%.
The diff coverage is 47.77%.

@@            Coverage Diff             @@
##           master   #12674      +/-   ##
==========================================
+ Coverage   42.20%   42.22%   +0.02%
==========================================
  Files         697      698       +1
  Lines       76589    76739     +150
==========================================
+ Hits        32325    32406      +81
- Misses      38948    38991      +43
- Partials     5316     5342      +26

Impacted Files
Coverage Δ

models/branches.go
41.61% <0.00%> (-0.29%)
:arrow_down:

models/issue_comment.go
52.71% <ø> (ø)

models/migrations/migrations.go
2.44% <ø> (ø)

models/migrations/v160.go
0.00% <0.00%> (ø)

models/pull.go
55.17% <0.00%> (ø)

modules/auth/repo_form.go
41.59% <ø> (ø)

modules/templates/helper.go
46.89% <0.00%> (-0.19%)
:arrow_down:

routers/repo/pull_review.go
0.00% <0.00%> (ø)

routers/api/v1/repo/pull_review.go
40.49% <20.00%> (-3.72%)
:arrow_down:

modules/notification/mail/mail.go
38.88% <33.33%> (-0.20%)
:arrow_down:

... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1bb5c09...46cbcc2. Read the comment docs.

ping

ping

Please resolve conflicts

Please resolve conflicts

@a1012112796 a local git merge --no-ff master && git push should solve this :)

@a1012112796 a local git merge --no-ff master && git push should solve this :)

@a1012112796 would good if you could resolve convlict ;)

:rocket:

authors: 6543 a1012112796 bagasme codecov-commenter codecov-io lafriks


text:
Fix bug isEnd detection on getIssues/getPullRequests (#13299)

backport from #13299

🚀

authors: lafriks lunny


text:
Fix error 500 on organization dashboard page

This pul request fix an error 500 on organization dashboard page. When an organization don't contains any repositories, the count SQL query return nothing.

Current coverage is 3.03% (diff: 0.00%)

Merging #147 into master will not change coverage

@@            master      #147   diff @@
========================================
  Files           33        33
  Lines         8096      8096
  Methods          0         0
  Messages         0         0
  Branches         0         0
========================================
  Hits           246       246
  Misses        7830      7830
  Partials        20        20

Powered by Codecov. Last update e2aa991...b39c6b1

I will send a PR to fix that.

is this fixed the same as #149?

It's not the same.

This should be a bug of xorm. I will fix it and we should not change gitea's code.

@lunny if you can change the behavior of count() on XORM to return 0 in case when zero rows has been returned by the query. It could be nice yeah.

Yes. I have. And this PR changed like you said.

Nice, you got my LGTM, just need one more to merge

Yes. So you can close this PR.

authors: 0xbaadf00d codecov-io lunny


text:
Move more model into models/user

as title

Codecov Report

Merging #17826 (eb52381) into main (fbadc1a) will increase coverage by 0.00%.
The diff coverage is 43.64%.

@@           Coverage Diff           @@
##             main   #17826   +/-   ##
=======================================
  Coverage   45.55%   45.56%
=======================================
  Files         808      808
  Lines       90061    90061
=======================================
+ Hits        41030    41032    +2
+ Misses      42477    42475    -2
  Partials     6554     6554

Impacted Files
Coverage Δ

models/error.go
40.00% <ø> (+0.75%)
:arrow_up:

models/migrate.go
0.00% <0.00%> (ø)

models/user.go
37.31% <0.00%> (ø)

routers/api/v1/repo/issue_subscription.go
30.26% <0.00%> (ø)

routers/web/admin/emails.go
0.00% <0.00%> (ø)

routers/web/org/members.go
0.00% <0.00%> (ø)

routers/web/user/auth.go
12.05% <0.00%> (ø)

routers/web/user/setting/account.go
27.47% <0.00%> (ø)

services/auth/login_source.go
0.00% <0.00%> (ø)

services/externalaccount/user.go
0.00% <0.00%> (ø)

... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fbadc1a...eb52381. Read the comment docs.

make L-G-T-M work

authors: codecov-commenter lunny


text:
Improve swagger doc

All is in the title
Need go-gitea/go-sdk#67

This is just comments, so it could make it in 1.2.0 without effect.

LGTM

@sapk if it's in time, I will move this to v1.2

@lunny I updated go-gitea/go-sdk#67. Will sync this when sdk is merged.

@sapk go-gitea/go-sdk#67 merged.

sdk updated and swagger re-generated.
PR is ready to be merged

LGTM

authors: appleboy lafriks lunny sapk


text:
add multi-line comment support in api

first step of #12640

add side and line to replace new/old_position in api like github

add start_line in api like github for multi-line comment creating

for multi-line comment, will cut all lines in range [start_line, line] for patch generate, then user can view all lines in this range on commnet list ui. example:

not suport start_side now, line and start_line should in same side

todos:

[ ] suport creating multi-line comments by ui & incomming mail
[ ] more ui updates

I have architectural objections to this PR:
At the moment, you store StartLine (+/-) and Line (+/-) (let's ignore the confusing naming for now).
But with your approach, you must to store 4 lines: Start (old), End (old), Start (new), End (new).
Otherwise you confuse everyone trying to maintain the code, and create technical debt.
There is a reason why I recommended a one-way multiline comment that only stores a relative counter.
It is much easier to implement, and more user-friendly.
You don't need any convoluted mechanism to calculate which line is included in your drag, thus you make it predictable for your user, and as a user, you very rarely need a multiline comment both on the old side as well as the new side.

But with your approach, you must to store 4 lines: Start (old), End (old), Start (new), End (new).
Otherwise you confuse everyone trying to maintain the code, and create technical debt.

why need four lines? do you means in database? now only add two new colums named as start_line and is_multi_line, the end_line is line  in db. and in fact start_line only will be used in patch generation step, which willn't break curent ui logic.
then, not support start_side and line in different sides now also, because it's hard to generate patch for this usage.

I guess what delvh wants to say is that instead of adding start_line, you could add a next_lines property. In case  next_lines is 0 it means would highlight just the line. By using a number like next_lines>=1 it would hightlight the next x lines starting by line as well.

authors: a1012112796 anbraten delvh


text:
Fix error when add user has full name to team

Will fix #2962.

LGTM

LGTM

also fixed #2726

authors: appleboy ethantkoenig lunny


text:
把clickhouse driver 的引用去掉

Describe the feature

把clickhouse driver 的引用去掉
Motivation

将clickhouse driver 的引用去掉，由用户自己去选择使用哪个driver。
目前我想使用http的click house driver，发现这个包并不支持，因此想让这个包去掉clickhouse driver的引用。
Related Issues

the latest clickhouse driver should support the http interface.

authors: jinzhu zhusichuang

repo: go-gorm/clickhouse


text:
Delete SQL Parsing error

gorm.io/driver/postgres v1.0.6
gorm.io/gorm v1.20.11

code:
	if err := db.Model(&models.FundMapping{}).Unscoped().Delete("id != ?","100").Error; err != nil {
		return err
	}

Execute return
2021/01/21 11:59:04 /home/wangy/workspace/2021/Insight/crawler/server/fund.go:280
[0.960ms] [rows:0] DELETE FROM "fund_mappings" WHERE "fund_mappings"."id" = '100'

	if err := db.Model(&models.FundMapping{}).Where("id != ?", "1").Unscoped().Delete(&models.FundMapping{}).Error; err != nil {
		return err
	}

	if err := db.Model(&models.FundMapping{}).Where("id != ?", "1").Unscoped().Delete(&models.FundMapping{}).Error; err != nil {
		return err
	}

repo: go-gorm/gorm


text:
Can't use preload when number of parameters exceeds 65535

Your Question
Hello everybody. I'm facing the same problem described in this issue and I would be very grateful if anyone could give me some guidance on how can I work around this.
Is the usage of preload for queries with a large number of parameters not recommended? Could you please suggest the better approach for cases like this?
Thank you!

The document you expected this should be explained
https://gorm.io/docs/preload.html

Expected answer
I would like to know if there is a better approach to this use case, when preload queries have more than 65535 parameters

I think preload just provides a convenient query method, but it may not be suitable when querying a large amount of data.
This is not only a problem of database parameter limitations, but may also include issues such as whether it causes index failure and whether a large amount of IO is generated.
For these situations, I think developers need to deal with it. Developers can reduce main table records through paging to reduce related table records, or they can use the Scopes API to implement things similar to Preload in batches.

@a631807682 Could you give me an example on how I could use the Scopes API to do this?

You can create a custom clause hook for the where clause and handle the IN (...) case separately.
You can add the hook after the database intialization like so (https://gorm.io/docs/write_driver.html):
DB.ClauseBuilders[clause.Where{}.Name()] = gormcustom.CustomWhereClauseHook

// [ ... ]

func CustomWhereClauseHook(c clause.Clause, builder clause.Builder) {
	if where, ok := c.Expression.(clause.Where); ok {
		for i, expr := range where.Exprs {
			if inClause, isIN := expr.(clause.IN); isIN {
				where.Exprs[i] = ANY{IN: inClause}
			}
		}
	}
	c.Build(builder)
}

In this way you can reimplement the clause.IN using a custom struct ANY implementing the interface clause.Expression.
var _ clause.Expression = &ANY{}

// IN is actually faster than ANY(ARRAY[]) because the cost of indexing is not convinient with a small number of values
const fewParameters = 30

// ANY reimplements [clause.IN] from gorm defaults; used to mitigate the "protocol limited to 65535 parameters" limitation
type ANY struct {
	clause.IN
}

// Build a custom postgres ANY clause and write it to the [gorm.Statement] wire
func (c ANY) Build(builder clause.Builder) {
	if len(c.Values) <= fewParameters {
		c.IN.Build(builder) // recall the default implementation when there are few values
		return
	}
	builder.WriteQuoted(c.Column)

	// extract the database type of the column values
	stmt, ok := builder.(*gorm.Statement)
	if !ok {
		panic("error in custom ANY clause, cannot cast clause.Builder to gorm.Statement")
	}
	dataType := getSchemaFieldType(c.Column.(clause.Column), stmt)

	// write the ANY array to the wire
	_, _ = builder.WriteString(" = ANY (ARRAY[")
	builder.AddVar(builder, c.Values...)
	_, _ = builder.WriteString(fmt.Sprintf("]::%s[])", dataType)) // ANY (ARRAY['value1', 'value2', 'value3']::uuid[]);
}

// getSchemaFieldType return the database driver column type extrascted from the provided [clause.Column]
func getSchemaFieldType(column clause.Column, stmt *gorm.Statement) string {
	fieldName := stmt.Quote(clause.Column{
		Table: "", // avoid passing the related table
		Alias: "", // avoid passing the related alias
		Name:  column.Name,
	})
	fieldName = strings.Trim(fieldName, "\"")
	field := stmt.Schema.LookUpField(fieldName)
	if field == nil {
		_ = stmt.DB.AddError(gorm.ErrModelAccessibleFieldsRequired)
		return "" // make it return an empty result, will error in statement
	}
	return string(field.DataType)
}

In this code snippet, we also try to determine the type of the c.Column in order to append it explicitly at the end of the ANY statement. For example, if we have an array of uuid.UUID in the c.Values interfaces, the syntax will become:
... = ANY (ARRAY['value1', 'value2', 'value3']::uuid[]);

There are also other forms of writing the ANY in postgres, for example, you could use the following syntax without specifying the type of the ANY arguments:
... = ANY ('{X,Y,Z}') AND ....

The caveat with this last solution is that you cannot directly reuse the builder.AddVar() call as it will write the arguments as separate comma-separated strings.

@lincolnjpg have a look at https://github.com/just-hms/gorm-any/blob/main/customclause/any.go
The error extended protocol limited to 65535 parameters is caused by to the fact that gorm.Statemtent's AddVar binds an array as a list of parameters, if the provided array is bigger then 65535 serializes then the postgres' parameters limit is reached.
A solution is to use create a custom clause which binds an array as a single variable, this is all the code you need
var (
	whereClause     = clause.Where{}.Name()
	postgresDialect = postgres.Dialector{}.Name()
)

// ANY is a custom implementation of the clause.IN which binds array of Values directly to a single variable
// it has been implemented to address the limitation of "protocol limited to 65535 parameters".
type ANY struct {
	clause.IN
}

// UseAny configures the DB to use the ANY type for IN clauses to resolve parameter limitations.
func UseAny(db *gorm.DB) {
	currentDialect := db.Dialector.Name()
	if currentDialect != postgresDialect {
		log.Printf("ANY clause not supported with %q dialect", currentDialect)
		return
	}

	db.ClauseBuilders[whereClause] = func(c clause.Clause, builder clause.Builder) {
		where := c.Expression.(clause.Where)
		for i, expr := range where.Exprs {
			if in, ok := expr.(clause.IN); ok {
				where.Exprs[i] = ANY{IN: in}
			}
		}
		c.Build(builder)
	}
}

// Build constructs the postgres ANY clause, used to make queries with large value lists work
func (c ANY) Build(builder clause.Builder) {
	// Only replace clause.IN with ANY for value lists, not subqueries
	hasNonValue := slices.ContainsFunc(c.Values, func(v any) bool {
		switch v.(type) {
		case sql.NamedArg, clause.Column, clause.Table, clause.Interface, clause.Expression, []any, *gorm.DB:
			return true
		}
		return false
	})

	// use clause.IN as default
	if hasNonValue || len(c.Values) <= 1 {
		c.IN.Build(builder)
		return
	}

	builder.WriteQuoted(c.Column)
	stmt := builder.(*gorm.Statement)

	// actual binding of the array
	// replacing `IN ($1, $2, $3)` with `= ANY ($1)`
	// which then translates to `= ANY([element, element2, element3, ...])`
	_, _ = builder.WriteString(" = ANY (")
	addBulk(stmt, c.Values)
	_, _ = builder.WriteString(")")
}

// addBulk integrates a list of values into the query, leveraging postgres's array binding support
func addBulk(stmt *gorm.Statement, v any) {
	stmt.Vars = append(stmt.Vars, v)
	stmt.DB.Dialector.BindVarTo(stmt, stmt, v)
}

authors: a631807682 ionfarima just-hms lincolnjpg


text:
Looking for maintainers

I haven't been actively maintaining this driver for a while since I'm no longer using Go. If you are interested in maintaining this driver please let me know.

/cc @safchain

@rushmorem I'm open to maintaining this driver.

@artooro Great! I have sent you an invitation.

@rushmorem I haven't seen anything yet.

Maybe the email wasn't delivered for some reason. You should also be able to accept the invitation at https://github.com/go-gremlin.

@rushmorem got it thanks.

Hey, this project is about to become a dependency of ours. I am happy to help maintain the repo if you would like.

@JessicaCGlenn I have sent you an invite.

Thanks :-)

@JessicaCGlenn are you the current maintainer of this project, want to know whether this project is in active use or maintenance.

Can we use this driver to connect with azure cosmos db ?
your response would be very helpful.
Thanks in advance.

Hi @rushmorem, I am interested in maintaining this project.
Due to the requirement, I may make some major changes in next version.

Are there any active maintainers of this driver?

authors: JessicaCGlenn artooro bcherukuri nigelis pankaj-nayak rushmorem sumitbadsara

repo: go-gremlin/gremlin


text:
微信商家批次转账到零钱回调通知

是不是少了微信商家批次转账到零钱回调的解析，没有在notify找到。
https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/transfer-batch-callback-notice.html

是不是少了微信商家批次转账到零钱回调的解析，没有在notify找到。 https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/transfer-batch-callback-notice.html

我看一下，补充上

感谢

authors: iGoogle-ink wuqinqiang

repo: go-pay/gopay


text:
Microservices Example

Is there a simple microservices example? Kratos example is more complex with authentication, authorization and event sourcing.

What feature do you request in this microservices example? Or what problem are you facing when apply this package to microservices?
This package provide a common pattern for resolving tenant and data isolation. You just need to apply the same logic in each standalone service or in the gateway. There is no big difference with monolithic

Do you have any detailed operation documents? If so, please provide them. Thank you very much!

authors: Goxiaoy ppusapati qcz-cell

repo: go-saas/saas


text:
Items Doesn't support maps whilst using map[string]string

Problem statement
I have this object:
// GroupSnapCreateRequest specifies a request to create a snapshot of given group.
// swagger:parameters snapVolumeGroup
type GroupSnapCreateRequest struct {
	// group id
	Id     string            `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Labels map[string]string `protobuf:"bytes,2,rep,name=Labels" json:"Labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}

I’m getting . items doesn’t support maps
Swagger specification
// parameters:
// - name: groupspec
//   in: body
//   description: GroupSnap create request
//   required: true
//   schema:
//    "$ref": "#/definitions/GroupSnapCreateRequest"

Swagger 2.0 doesn't support map[string]* except through "additionalProperties".  I'm not sure how you would annotate this, or if it's even possible.

based on this:
https://github.com/go-swagger/go-swagger/issues/960
i figured map[string]string would be supported.

hmm looks like changing parameter to model worked?

after changing it to Model.

Okay, so it did generate additionalProperties under Labels.  That's good.

repo: go-swagger/go-swagger


text:
Models: add support for $ref indirections

introduces golang aliased type declarations (e.g. type A = B) to support definitions with indirections as $ref

fix response template to accomodate these situations

special provisions are taken for aliases on polymorphic types: use golang aliased type syntax, but redefine unmarshalling factories

fixes #1260

NOTES:
For complex (non-polymorphic) types, the type composition construct (e.g. type A struct { B }) remains unchanged.
For simple types (slices, maps, primitives) or polymorphic types, golang type aliases are used.
See fixtures/bugs/1260/fixture-realiased-types.yaml for examples.

Generated code using this feature requires go1.9+
Signed-off-by: Frederic BIDON fredbi@yahoo.com

is pointer access/nullable support in this patch? I am beating my head against the fixed models atm not doing this.

No there is no such things. Just felt like I had to fix one of the very first issues I raised... not related with nullable whatsoever

authors: erikh fredbi


text:
Cannot run the command: gold: error: cannot open ./...: No such file or directory

Hi,
I've followed the documentation to obtain gold using go get but once I try to run it I getting some errors:
$ export GO111MODULE=on
$ gold std
gold: error: cannot open std: No such file or directory
$ gold ./...
gold: error: cannot open ./...: No such file or directory
$ go version
go version go1.14.7 linux/amd64

I'm trying to see documentation of this package, v2 branch.
Can you help me?

Could you show the result of which gold and gold -h?
It looks there is another gold program installed in your machine.
If this is true, you can install Gold as other names suggested in the readme file.

You were totally right! Another gold command was colliding. Thanks!


text:
gobyexample interfaces.go surplus code in generated methods

I don't understand what purpose the first line of generated Haxe code for each Go method has:
@:keep class T_rect_static_extension {
	@:keep
	public static function _perim(_r:T_rect):GoFloat64 {
		(_r == null ? null : _r.__copy__()); // ****what does this code do?****
		return (((2 : GoFloat64)) * _r._width) + (((2 : GoFloat64)) * _r._height);
	}

	@:keep
	public static function _area(_r:T_rect):GoFloat64 {
		(_r == null ? null : _r.__copy__()); // ****what does this code do?****
		return _r._width * _r._height;
	}
}

@:keep class T_circle_static_extension {
	@:keep
	public static function _perim(_c:T_circle):GoFloat64 {
		(_c == null ? null : _c.__copy__()); // ****what does this code do?****
		return ((6.283185307179586 : GoFloat64)) * _c._radius;
	}

	@:keep
	public static function _area(_c:T_circle):GoFloat64 {
		(_c == null ? null : _c.__copy__()); // ****what does this code do?****
		return (((3.141592653589793 : GoFloat64)) * _c._radius) * _c._radius;
	}
}

Legacy code when methods could be included into the Class of struct types. Thanks for the find!

Surplus code no-longer being generated.


text:
--output-json flag not working

Hey!
Thanks for all your work on this pretty neat tool!
Just a quick report. Readme lists a flag --output-json, but code implements a corresponding functionality for a flag --json-output. I could've submit a PR, but I'm not sure, which one you want to stick with.

yea +1 on that, i think they meant --json-output

repo: goadapp/goad


text:
.env file variables are cached

.env changes are not propagated to code.
If you update .env, new values will not be detected until you change the file that imports the variables.

are you re-building between .env changes?

I'm using react-native run-ios, which reloads the code. Could be that babel modules are not reloaded until some code ts/js code changes.

yeah unfortunately, you'll have to fully restart the script every time you change your .env file

I run react-native run-ios whenever I modify .env file. However, old environment variables are cached and leveraged again. What should I do to reset them?

Oh! I think I know what's wrong. This is one of the caveats about this package. For now, try this and let me know if that fixes it:
rm -rf node_modules/.cache/babel-loader/*

I also want to see if we can observe changes and clear the cache going forward like in this other babel plugin https://github.com/codemix/babel-plugin-closure-elimination/blob/master/src/index.js

@goatandsheep Thank you! It eventually resolved the issue. Could you update the package?

It will take time for me to figure it out. I'll update the security dependencies, but this feature will have to wait until next month unless someone can help me.

Oh! I think I know what's wrong. This is one of the caveats about this package. For now, try this and let me know if that fixes it:
rm -rf node_modules/.cache/babel-loader/*

I also want to see if we can observe changes and clear the cache going forward like in this other babel plugin https://github.com/codemix/babel-plugin-closure-elimination/blob/master/src/index.js

I have same problem, but It cannot solve my problem
I also cleared watchman, metro module cache, but nothing changes.
Both on android, iOS environment

Maybe a temp solution for updating package.json scripts:

"cc": "rimraf node_modules/.cache/babel-loader/*,",
"android": "npm run cc && react-native run-android",
"ios": "npm run cc && react-native run-ios",

Repost from https://github.com/zetachang/react-native-dotenv/issues/70, after a lot of digging, I think this https://github.com/babel/babel/issues/8497 is really what react-native-dotenv needs to get this fixed. Seeing as there is currently no way to tell babel that the .env file is a dependency requiring a new build react-native-dotenv cannot possibly get it to rebuild when the env file changes.
I think I have a partial workaround though, changing metro.config.js to include:
const crypto = require('crypto');
const fs = require('fs');

let hash = crypto.createHash('sha256');
hash.update(fs.readFileSync('.env'));
const cacheVersion = hash.digest('hex');

module.exports = { // eslint-disable-line import/no-commonjs
  ...
  cacheVersion,
};

See: https://facebook.github.io/metro/docs/configuration#cacheversion
This results in metro using the hash of the .env file as a cache key and therefore invalidates the cache when the env file changes. I don't believe this will work for live reloading, you would still need to restart react-native whenever the env or any files using it changes, but we've been running with this for some time and haven't had anymore env caching issues.
This is particularly pressing for us because our CI agents build JS bundles for 3 different enviornments in an unpredictable order so any env caching between those could cause a production outage for us. But thankfully we haven't seen that for the last few months since doing this change.

Looks like https://github.com/babel/babel/pull/11741 might provide a proper solution here also?

when I ran "rm -rf node_modules/.cache/babel-loader/*", got module not found error. I do not see .cache folder inside node_modules

Same issue. rm -rf node_modules/.cache/babel-loader/* does not seem to help

@TJTorola https://github.com/zetachang/react-native-dotenv/issues/70#issuecomment-645559873
I have experienced this issue a couple of times.I know this doesn't solve the underlying issue with pertaining to live re loads
But when you cp or update your .env with new values before running your code push command you can pass the --extra-bundler-option="--reset-cache" flag
Example
appcenter codepush release-react -a ${app} --mandatory true -t ${version} --output-dir ./build --deployment-name ${deployment} --extra-bundler-option="--reset-cache"

after env swaps the new env values should be picked up when you codepush

@kingdavidmartins Yeah, that works as well. My goal with hashing the .env file is that it does basically that, but automatically. Though, when doing a appcenter release it's probably best to ditch the cache every single time just to be safe like you have there.

@TJTorola anything we can do to the library to automatically do this? I'm happy to accept any PRs. I really want to resolve this.

@goatandsheep I'm not sure, I don't think it can be properly fixed without https://github.com/babel/babel/pull/11741 getting patched first.

for expo users,
expo r -c
did the job !

this should help
yarn start --reset-cache

Another approach with embeding the reset unto run-* commands
Android:
extraPackagerArgs: ["--reset-cache", ...],
inside app/build.gradle
IOS:
Edit scheme->Run-> add
EXTRA_PACKAGER_ARGS='--reset-cache' under ENV variables.

@goatandsheep I think this issue should be re-opened, and perhaps even pinned. This is not an issue with babel-loader so the caveat currently in the README does not address this issue (I do not have babel-loader in my yarn.lock nor do I have the node_modules/.cache directory).
This issue can be reproduced by init'ing a new React Native project with:
npx react-native init MyApp --template react-native-template-typescript
And then adding this dependency. Until yarn start --reset-cache is provided, no environmental variables appear within the app, and no changes are reflected until the cache is reset again.

@taylorkline HM... Sorry to hear about the continuing issues. What do you recommend we do? React native uses babel. If you have issues and it's not using babel loader but it's solved with this other yarn command that is also included in the readme, then isn't it solved? How can I help?

If you have issues and it's not using babel loader but it's solved with this other yarn command that is also included in the readme, then isn't it solved?

Ah, I see. I had a misunderstanding.
As it's currently written, the caveats section sounds like it only applies specifically to people who might have manually added a babel caching solution.
Since this issue of caching applies to the majority of users, including anyone who adds this project to a new React Native project, I would really suggest adding something like:
"You must clean the babel cache after each change to your environmental variables using yarn start --reset-cache or, if using expo, expo r -c."
up more prominently within the Usage section of the README.
Thanks for hearing me @goatandsheep

That's good feedback 👍 I'll try to improve the readme to clarify

I have tried everything from expo r -c to yarn start --reset-cache. I think at the end of the day it may require a computer restart... thanks @goatandsheep for working on a solution. I see you all accross the forums working on this. 🙏

yarn start --reset-cache works for me!

Using expo expo r -c works ... But as I have to change often of environnements... It's annoyingly long ! :'(
Deleting the node_modules/.cache/babel-loader/ solution seems to be a more effective way ... But I can't find any '.cache' folder in my nodes_modules :(
I din't try the @TJTorola's solution yet ... But seems overcomplicated ...

I think I have a partial workaround though, changing metro.config.js to include:

@goatandsheep It looks like https://github.com/babel/babel/pull/11741 got approved a few days ago. Maybe something to keep an eye on since with that API we could properly fix this problem.

@TJTorola I've been checking it every day. I never thought that would happen but since it seems it will happen I will reopen this ticket

Not sure if this helps but setting resetCache: true in metre.config.js makes cache reset everytime metro starts (anyway you it gets started).

@goatandsheep Please try resetCache: true in metro.config.js as per @andidev  answer its work for me.
Thanks @andidev

My solution 😂:
Package.json file:
"start:dev": "APP_ENV=dev npx react-native start --reset-cache",
"start:staging": "APP_ENV=staging npx react-native start --reset-cache",
"start:prod": "APP_ENV=prod npx react-native start --reset-cache",

What a stupid issue. And nothing I've tried in this thread has been able to fix it.

@lkdm This issue has been reopened as a placeholder to maintainers awaiting babel updates but if the readme is insufficient please provide more information

@goatandsheep I was able to solve it by rm -rfìng the entire repository and pulling from remote.

That will do it but you'll have to figure out a solution that works every time you change your dotenv values. For now i recommend adding the babel cache false but when this is merged in you won't have to

resetCache: true is working for me

changes from the babel PR are merged! Time to implement this when the next babel release comes out: https://github.com/babel/babel/pull/14065#issuecomment-1009334079

if people can help review the incoming PR #288 , that will help tremendously. I will publish it under a next tag to it after I get review

please test the next version https://www.npmjs.com/package/react-native-dotenv/v/3.4.0 if I get 3 thumbs up from the post I'll publish this as the proper change

@goatandsheep I've tested v3.4.0 and experience the following issue (using Expo and v3.3.1 of react-native-dotenv this particular issue does not occur). I haven't changed anything, other that installing the v3.4.0 version of react-native-dotenv.
I will look into this in more detail, but perhaps you can spot the issue right away.
C:/Users/USER/AppData/Roaming/npm/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js
Module build failed (from C:/Users/USER/AppData/Roaming/npm/node_modules/expo-cli/node_modules/babel-loader/lib/index.js):
TypeError: [BABEL] C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\node_modules\react-dev-utils\webpackHotDevClient.js: api.addExternalDependency is not a function (While processing: "Z:\\Connected.Football\\monorepo\\mobile-app\\node_modules\\react-native-dotenv\\index.js")
    at module.exports (Z:\Connected.Football\monorepo\mobile-app\node_modules\react-native-dotenv\index.js:105:7)
    at C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@babel\core\lib\config\full.js:199:14
    at Generator.next (<anonymous>)
    at Function.<anonymous> (C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@babel\core\lib\gensync-utils\async.js:26:3)
    at Generator.next (<anonymous>)
    at step (C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\node_modules\gensync\index.js:261:32)
    at evaluateAsync (C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\node_modules\gensync\index.js:291:5)
    at Function.errback (C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\node_modules\gensync\index.js:113:7)
    at errback (C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@babel\core\lib\gensync-utils\async.js:70:18)
    at async (C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\node_modules\gensync\index.js:188:17)
    at onFirstPause (C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\node_modules\gensync\index.js:216:13)
    at Generator.next (<anonymous>)
    at cachedFunction (C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@babel\core\lib\config\caching.js:68:46)
    at cachedFunction.next (<anonymous>)
    at loadPluginDescriptor (C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@babel\core\lib\config\full.js:235:43)
    at loadPluginDescriptor.next (<anonymous>)

@goatandsheep I'll try and take a look at that version sometime this or next week.

Tested on 3.4.0 and the env are not updated without --clear still.
i have a ROOT_API in  .env
and one in .env.staging
and switching between both this doesn't change the ROOT_API unless i do --clear :)
    "start": "NODE_ENV=development expo start",
    "start:staging": "NODE_ENV=staging expo start",

I'm seeing this behavior when using typescript/tsc any idea of how to reliably delete the cache?

this should help yarn start --reset-cache
Possibile duplicate: zetachang/react-native-dotenv#24

Thanks thats work for me!!

this should help yarn start --reset-cache
Possibile duplicate: zetachang/react-native-dotenv#24

Thanks. Thats work for me

Nothing mentioned above seems to work for my expo project mixed up with react web stuffs

None of the above solutions worked for me, and finally this works: https://github.com/zetachang/react-native-dotenv/issues/24#issuecomment-581125204. And this is super annoying as if I have 10 files using the environment variable, I have to change all the files...

None of the above solution worked for me, but I just found the cached files and removed them.
First, to search where was the cached files (with expo, but you might be able to find them elsewhere without it) :
grep . -rne "API_URL"

I then found it in .expo/web/cache/development/babel-loader/481dd7b81fe573de380af60e33e4c7b2.json.
Therefore to regenerate it, I just cleaned it (and restart the app):
rm -rf .expo/web/cache

None of the above solution worked for me, but I just found the cached files and removed them.
First, to search where was the cached files (with expo, but you might be able to find them elsewhere without it) :
grep . -rne "API_URL"

I then found it in .expo/web/cache/development/babel-loader/481dd7b81fe573de380af60e33e4c7b2.json. Therefore to regenerate it, I just cleaned it (and restart the app):
rm -rf .expo/web/cache

Man you save my day!!!! This works thanks.

I'm still having the same problem

still having issues on expo 45. Have tried every solution in here.

Tried all solutions above and none worked for me.
This nuke worked.
rm -rf node_module && npm i
Cheers!

Tried all solutions above and none worked for me.
This nuke worked.
rm -rf node_module && npm i
Cheers!

The problem lies in  node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m this file is not reflecting the changes you made in your .env file.

Hi @esphung issues specific to that environment no longer exist. Please open a new ticket explaining your setup

authors: Akshh057 Definence GoaGit Michael-Davison SebinLee TJTorola XAMEUS alequint8912 alessandrogelmi andidev bhailot cbroome cgallivanpam danteyc goatandsheep haotang-dayone haotangio hatemalimam himgodfreyho kingdavidmartins liuyankit lkdm mvehar nisargrthakkar perroudsky phankietit proIT324 seba9999 shafayeatsumit taylorkline wcastand

repo: goatandsheep/react-native-dotenv


text:
Leave markup without state/meta alone

const iso = new Iso();

iso.add('<!DOCTYPE html>');

this.body = iso.render();

produces:

<!DOCTYPE html>

This is because of:

https://github.com/goatslacker/iso/blob/feac66165c82d3f6d77eac17d0068b2ac86fd278/src/iso.js#L20-L30

My recommendation is that <!DOCTYPE html> is produced without wrapping.  (Similarly, whitespace can be trimmed from the output).
There shouldn't be a need to worry about changing key indexes or anything...
Thoughts?

Iso is meant to be used to wrap whatever content you want to render that needs JS to bootstrap. Document types, scripts, stylesheets, etc...should be rendered elsewhere.
const iso = new Iso();

iso.add(someMarkupYouCreate);

this.body = `<!DOCTYPE html>

    ${iso.render()}

I can't think of how to cleanly exclude document type without having to also worry about the other cases and I don't want this to turn into a giant library. Perhaps this can be a separate utility that handles rendering the whole document.
Do you have any ideas on how this could work?

lol.
Guess what I just wrote after opening this issue?
    iso.add(React.renderToString(<Layout />), state, meta);

    this.body = `
      <!DOCTYPE html>

          <meta charset="UTF-8">

          ${iso.render()}

    `;

I was thinking of wrapping the code here with a check on if (!Object.keys(state[i]).length && !Object.keys(meta[i]).length) and just returning markup as-is (since there was nothing to bootstrap).

https://github.com/goatslacker/iso/blob/feac66165c82d3f6d77eac17d0068b2ac86fd278/src/iso.js#L20-L30

It it works, would you be open to that?  It would remove superfluous wrappers when there's no state / meta to bootstrap...

On another note, as a neat FYI, I'm trying out streams from Webpack to dynamically generate the

authors: ericclemmons goatslacker

repo: goatslacker/iso


text:
made master branch to be v2 and updated dependencies

As a part of gobuffalo/buffalo#2152, updated dependencies (logger, packd, and others)
Before doing that, I made the root tree be v2 as suggested as #294. (The purpose of this diet is for making maintenance easier while we keep packr with minimal effort)
Fixes #294

This broke our CI pipeline for several projects :'(
The installation methods in the README need to be updated.
$ go get -u github.com/gobuffalo/packr/v2/packr2

this no longer works.

repo: gobuffalo/packr


text:
demo website is getting a 502 and wont load

The demo website for the chat application doesn't seem to be working and providing a 502 error.

Does it? Right now it works.

authors: ChadTaljaardt gobwas

repo: gobwas/ws-examples


text:
Fix bug.  support for task execution without arguments

Now. can not execution no args tasks.
@shared_task
def test_task():
    print("Hello, World!")

func main() {

        cli, _ := gocelery.NewCeleryClient(
                gocelery.NewRedisCeleryBroker(REDIS_URL),
                gocelery.NewRedisCeleryBackend(REDIS_URL),
                1,
        )

        asyncResult, err := cli.Delay(test_task)
        if err != nil {
                panic(err)
        }

go run main.go
[2019-06-26 17:37:44,256: ERROR/ForkPoolWorker-2] Task test_task[cd94a9db-cdec-43f4-be87-7474df4cca21] raised unexpected: TypeError('test_task object argument after * must be an iterable, not NoneType')
Traceback (most recent call last):
  File "/$HOME.local/share/virtualenvs/test-python-repo--NH_gJ4S/lib/python3.7/site-packages/celery/app/trace.py", line 385, in trace_task
    R = retval = fun(*args, **kwargs)
TypeError: test_task object argument after * must be an iterable, not NoneType

https://github.com/gocelery/gocelery/blob/master/message.go#L171
Add below code.
fmt.Printf(stirng(jsonData))
Debug log.
{"id":"81af5e46-b6dc-46c3-9057-d21202d9c2aa","task":"vulns.tasks.test_task","args":null,"kwargs":{},"retries":0,"eta":null}
args is null.

I'm sorry. why failed ci test...
Please advice.

Can't stop worker Within 10 seconds...

my temporary workaround is just pass array as variadic input
package main

import (
	"github.com/gocelery/gocelery"
)

func main() {
	cli, _ := gocelery.NewCeleryClient(
		gocelery.NewAMQPCeleryBroker("amqp://guest:guest@localhost:5672/"),
		gocelery.NewAMQPCeleryBackend("amqp://guest:guest@localhost:5672/"),
		1,
	)

	args := make([]interface{}, 0)
	_, err := cli.Delay("my_package.my_task", args...)
	if err != nil {
		panic(err)
	}

}

Thank you @afdalwahyu
Me too. Now, I adapt the same workaround.
I made a PR as a permanent measure, but isn't it?

Added additional tests and merged the changes into master.
https://github.com/gocelery/gocelery/pull/150

Thank you add test.
I didn't recieve notification...

authors: afdalwahyu masahiro331 sickyoon

repo: gocelery/gocelery


text:
Drop support for Node.js 10.x

Node.js 10.x is end-of-life since 2021-04-01, so new major versions of flora can drop support for Node.js < 12.

Fixed in 6152bc4

repo: godmodelabs/flora


text:
Usage Guide / Godot Translation / Documentation

Installation was easy enough, but it's difficult to know how to translate code/concepts from GDScript to gdext-nim, or figuring out how to use it. I'm looking at your demo examples and that's of course helpful but a proper guide is needed for a beginner to understand quickly.
Here's what I got so far (might be wrong) as an example:
You can't attach a nim-script to a node - you have to create and register classes like with class_name and then create that that class-node. Add your class-level variables to the type. Use the pragma {.gdexport.} to make them accessible in the inspector.
type MyClass* = ptr object of Node3D
    score :int = 0
    mob_scene* {.gdexport.} :GdRef[PackedScene]
    player* {.gdexport.} :Node3D

You can reference the datatypes of all Godot classes as long as you've imported gdext, but in order to use their methods and properties you need to import the actual class, which is located in gdext/classes/ with the names beginning with gd.
import gdext/classes / [gdNode3D]

For your class you'll mostly want to create routines which take as their first argument the type of your class. The gdsync pragma allows hotreloading? If you're overloading routine then it needs to be a method and not start with _.
method ready(self :MyClass) {.gdsync.} = discard
proc do_thing(self :MyClass) {.gdsync.} = discard

Your code will run in the editor as well (like with the @tool annotation), use Engine.isEditorHint to check.
method process(self :MyClass, delta :float) {.gdsync.} =
    if Engine.isEditorHint: return
    # the following code will not run in the editor

There's syntax to reference nodes in the scene like with dollar-sign ($), but I think it could be improved. I don't know about unique name; percentage (%).
let node = self/"Path"/"to"/"Node" as Sprite2D
let other_node = self.getNode("Path/to/ThisNode") as MeshInstance3D

Builtin global functions have the same names. Types like Vector3 etc do not need to be imported and work like in GDScript, but the constructor is lower case and names are technically Capitalized instead of UPPERCASE - nim of course allows uppercase anyway.
self.position = vector3(0, 0, 0) + Vector3.Down + Vector3.DOWN
print self.position.length

Create new instances of nodes using instantiate, with an optional name for the node.
let node :Node3D = Node3D.instantiate "some name"
node.position = vector3(0, 0, 3)
self.add_child(node)

Nodes, and some other things, ultimately inherit from Object and their types are simple. Others inherit from RefCounted which means they're encapsulated with GdRef. If you need access to the plain datatype without GdRef they can be dereferenced with [].
let mi :MeshInstance = instantiate MeshInstance # Object type
let st :GdRef[SurfaceTool] = instantiate SurfaceTool # RefCounted type
st[].begin(primitiveTriangles) # st needs dereferencing
let m :GdRef[ArrayMesh] = st[].commit()
mi.mesh = m as GdRef[Mesh] # Casting to super type

Also note, builtin enums (like Mesh.PRIMITIVE_TRIANGLES in this case) are slightly different from Godot; look for them in gdext/gen/globalenums.nim and gdext/gen/localenums.nim.
I haven't gotten to signals yet.. Look at Dodge the Creeps demo.

I would like to post this as a wiki, can you help?
I can offer two ways:

Join godot-nim org and compile a wiki
I would like to leave the organization to you if possible, but if necessary, I can create a template for you.

Continue to edit this Issue and I will reflect it in the wiki sequentially

In any case, we will credit you in the relevant section of the wiki and in the project readme. How about it?

I might as well join and edit the wiki =)

We have sent you an invitation. You probably received it to your registered email on github.
The wiki is provided by github: https://github.com/godot-nim/gdext-nim/wiki
We do not have a specific structure for the wiki as a whole, but we recommend that the guide be single-page.
The github wiki indexes header elements directly in the sidebar, so please set the header with appropriate granularity.
FYI:

Basic writing and formatting syntax
Adding or editing wiki pages

The wiki has been updated.

Awesome work!
Btw there are some less common code in the guide, can you just fix that?
(Here we assume that nimpretty format is what is common.)
Replacement rule:  :Type -> : Type
Examples:
 type MyClass* = ptr object of Node3D
<    score :int = 0
>    score: int = 0
<    mob_scene* {.gdexport.} :GdRef[PackedScene]
>    mob_scene* {.gdexport.}: GdRef[PackedScene]
<    player* {.gdexport.} :Node3D
>    player* {.gdexport.}: Node3D

Yeah, I always write name :type and similar. The colon specifies a type so it makes sense that it's "attached" to the type and not the name. But I can change it to the common style.
I think GdRef[T] is more clear as a type, while gdref T looks more like a command, or other special keyword. I know you've chosen the latter in your source. I assume that's because you're emulating of the real keyword ref but for Godot. On one hand it's ergonomic to think of it that way, on the other hand it's confusing because it is actually not.
I'm not sure, but if gdref T does work just like ref in all cases without any gotchas then I think it can be good. It just made it clearer to me as GdRef[T] while I was figuring out the difference between Objects and RefCounted.

But I can change it to the common style.

Considering, I don't think the position of the colon would confuse users. I will respect your style.
About GdRef - gdref
Thank you for sharing your thoughts in detail.
Indeed, it may be only those who know the internal implementation that can be pleased with the similarity in form. I'll treat it like syntax sugar from now on.

I added a section on Life of Object to your guide.
motivation: #120

repo: godot-nim/gdext-nim