text:
Publishing not working

Hey,
I got Python 3.5.2 here, on a ubuntu 16.04 and a rabbitpy of version 1.0.0.
When executing exactly the code from the example in "Mandatory Publishing"
http://rabbitpy.readthedocs.io/en/latest/examples/publisher_confirms.html
I got that error:
$ python3 publish_example.py

Traceback (most recent call last):
  File "publish_example.py", line 19, in <module>
    print('RabbitMQ indicates message publishing failure')
  File "/usr/local/lib/python3.5/dist-packages/rabbitpy/connection.py", line 149, in __exit__
    raise exc_val
  File "publish_example.py", line 19, in <module>
    print('RabbitMQ indicates message publishing failure')
  File "/usr/local/lib/python3.5/dist-packages/rabbitpy/channel.py", line 99, in __exit__
    raise exc_val
  File "publish_example.py", line 16, in <module>
    if message.publish('test_exchange', 'test-routing-key', mandatory=True):
  File "/usr/local/lib/python3.5/dist-packages/rabbitpy/message.py", line 288, in publish
    response = self.channel.wait_for_confirmation()
  File "/usr/local/lib/python3.5/dist-packages/rabbitpy/base.py", line 242, in wait_for_confirmation
    specification.Basic.Nack])
  File "/usr/local/lib/python3.5/dist-packages/rabbitpy/base.py", line 464, in _wait_on_frame
    self._check_for_rpc_request(value)
  File "/usr/local/lib/python3.5/dist-packages/rabbitpy/channel.py", line 271, in _check_for_rpc_request
    super(Channel, self)._check_for_rpc_request(value)
  File "/usr/local/lib/python3.5/dist-packages/rabbitpy/base.py", line 328, in _check_for_rpc_request
    self._on_remote_close(value)
  File "/usr/local/lib/python3.5/dist-packages/rabbitpy/base.py", line 380, in _on_remote_close
    raise exceptions.AMQP[value.reply_code](value)
rabbitpy.exceptions.AMQPNotFound: <pamqp.specification.Channel.Close object at 0x7ffa2f81a5a0>

I tried this example, because in the app I am building, publishing also doesn't work. As you can see, the broker is up and running, also the connection gets established nicely. But when it comes to find the proper exchange, a 404 is returned. I tried another URL without the trailing / for the vhost, resp. omitted the exchange, but neither worked out.
/usr/local/lib/python3.5/dist-packages/rabbitpy/base.py:380: AMQPNotFound
---------------------------------------------- Captured log -----------------------------------------------
base.py                    100 DEBUG    Connection setting state to 'Opening'
base.py                    100 DEBUG    IO setting state to 'Opening'
events.py                  132 DEBUG    Waiting for 3 seconds on event: Socket Connected
io.py                      532 DEBUG    Connecting to ('172.18.0.2', 5672)
base.py                    100 DEBUG    IO setting state to 'Open'
io.py                      400 DEBUG    Socket connected
connection.py              246 DEBUG    Adding channel 0 to io
base.py                    100 DEBUG    Channel0 setting state to 'Opening'
io.py                      235 DEBUG    Returning PollPoller
channel0.py                101 DEBUG    Received frame: 'Connection.Start'
channel0.py                242 DEBUG    Server b'version': b'3.6.5'
channel0.py                242 DEBUG    Server b'cluster_name': b'rabbit@a2930e58b427'
channel0.py                242 DEBUG    Server b'platform': b'Erlang/OTP'
channel0.py                242 DEBUG    Server b'capabilities': {b'per_consumer_qos': True, b'authentication_failure_close': True, b'consumer_cancel_notify': True, b'publisher_confirms': True, b'basic.nack': True, b'connection.blocked': True, b'direct_reply_to': True, b'consumer_priorities': True, b'exchange_exchange_bindings': True}
channel0.py                242 DEBUG    Server b'product': b'RabbitMQ'
channel0.py                242 DEBUG    Server b'copyright': b'Copyright (C) 2007-2016 Pivotal Software, Inc.'
channel0.py                242 DEBUG    Server b'information': b'Licensed under the MPL.  See http://www.rabbitmq.com/'
channel0.py                101 DEBUG    Received frame: 'Connection.Tune'
channel0.py                259 DEBUG    Heartbeat interval (server/client): 60/60
channel0.py                101 DEBUG    Received frame: 'Connection.OpenOk'
channel0.py                219 DEBUG    Connection opened
base.py                    100 DEBUG    Channel0 setting state to 'Open'
heartbeat.py                36 DEBUG    Heartbeat started, ensuring data is written at least every 30.00 seconds
base.py                    100 DEBUG    Connection setting state to 'Open'
endpoint.py                100 INFO     Established connection to host: rabbitmq, port: 5672
connection.py              246 DEBUG    Adding channel 1 to io
base.py                    100 DEBUG    Channel setting state to 'Opening'
channel.py                 270 DEBUG    Checking for RPC request: <pamqp.specification.Channel.OpenOk object at 0x7f815dd24c48>
base.py                    100 DEBUG    Channel setting state to 'Open'
channel.py                 186 DEBUG    Channel #1 open
channel.py                 270 DEBUG    Checking for RPC request: <pamqp.specification.Confirm.SelectOk object at 0x7f815dcabb70>
endpoint.py                111 INFO     Created channel
amqp_queue.py              384 DEBUG    Declaring Queue test_queue, durable=False, passive=False, exclusive=False, auto_delete=False, arguments={}
base.py                     37 DEBUG    Issuing RPC to RabbitMQ: <pamqp.specification.Queue.Declare object at 0x7f815dc86e18>
channel.py                 270 DEBUG    Checking for RPC request: <pamqp.specification.Queue.DeclareOk object at 0x7f815dcb2b88>
endpoint.py                139 INFO     Declared queue with name: test_queue
channel.py                 270 DEBUG    Checking for RPC request: <pamqp.specification.Basic.ConsumeOk object at 0x7f815dd24cd8>
base.py                    100 DEBUG    Connection setting state to 'Opening'
base.py                    100 DEBUG    IO setting state to 'Opening'
events.py                  132 DEBUG    Waiting for 3 seconds on event: Socket Connected
io.py                      532 DEBUG    Connecting to ('172.18.0.2', 5672)
base.py                    100 DEBUG    IO setting state to 'Open'
io.py                      400 DEBUG    Socket connected
io.py                      235 DEBUG    Returning PollPoller
connection.py              246 DEBUG    Adding channel 0 to io
base.py                    100 DEBUG    Channel0 setting state to 'Opening'
channel0.py                101 DEBUG    Received frame: 'Connection.Start'
channel0.py                242 DEBUG    Server b'version': b'3.6.5'
channel0.py                242 DEBUG    Server b'cluster_name': b'rabbit@a2930e58b427'
channel0.py                242 DEBUG    Server b'platform': b'Erlang/OTP'
channel0.py                242 DEBUG    Server b'capabilities': {b'per_consumer_qos': True, b'authentication_failure_close': True, b'consumer_cancel_notify': True, b'publisher_confirms': True, b'basic.nack': True, b'connection.blocked': True, b'direct_reply_to': True, b'consumer_priorities': True, b'exchange_exchange_bindings': True}
channel0.py                242 DEBUG    Server b'product': b'RabbitMQ'
channel0.py                242 DEBUG    Server b'copyright': b'Copyright (C) 2007-2016 Pivotal Software, Inc.'
channel0.py                242 DEBUG    Server b'information': b'Licensed under the MPL.  See http://www.rabbitmq.com/'
channel0.py                101 DEBUG    Received frame: 'Connection.Tune'
channel0.py                259 DEBUG    Heartbeat interval (server/client): 60/60
channel0.py                101 DEBUG    Received frame: 'Connection.OpenOk'
channel0.py                219 DEBUG    Connection opened
base.py                    100 DEBUG    Channel0 setting state to 'Open'
heartbeat.py                36 DEBUG    Heartbeat started, ensuring data is written at least every 30.00 seconds
base.py                    100 DEBUG    Connection setting state to 'Open'
endpoint.py                100 INFO     Established connection to host: rabbitmq, port: 5672
connection.py              246 DEBUG    Adding channel 1 to io
base.py                    100 DEBUG    Channel setting state to 'Opening'
channel.py                 270 DEBUG    Checking for RPC request: <pamqp.specification.Channel.OpenOk object at 0x7f815dd24f18>
base.py                    100 DEBUG    Channel setting state to 'Open'
channel.py                 186 DEBUG    Channel #1 open
channel.py                 270 DEBUG    Checking for RPC request: <pamqp.specification.Confirm.SelectOk object at 0x7f815dcabba8>
endpoint.py                111 INFO     Created channel
channel.py                 270 DEBUG    Checking for RPC request: <pamqp.specification.Channel.Close object at 0x7f815c608f30>
base.py                    327 DEBUG    Channel closed
base.py                    100 DEBUG    Channel setting state to 'Remotely Closed'
base.py                    379 ERROR    Received remote close (404): b"NOT_FOUND - no exchange 'test-exchange' in vhost '/'"

This is how I open a connection:
        self._connection = rabbitpy.Connection('amqp://guest:guest@localhost:5672/%2F')

After that the channels/ connection are closed. I am sure, I am missing something and really could use a nudge in the right direction.
Thanks in advance :-)

This comes a bit late, but the error states that the defined exchange is unknown. Unfortunately this reply does not bubble up and rabbitpy quits with this (not helpful) AMQPNotFound Exception.

Going to close this, but the AMQP NotFoundException is straight out of the protocol and the response from RabbitMQ. I guess I could create a bunch of new exceptions inspecting the not found exception for what was not found, but that seems like a fair amount of extra code with little value.

authors: gmr novalis111 tarhann

repo: gmr/rabbitpy


text:
🛑 i 學園 is down

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

HTTP code: 0
Response time: 0 ms

Resolved: i 學園 is back up in fb47bd4.

source: gharchive/issue

repo: gnehs/ntut-uptime

license: MIT

license_type: permissive

license_source: github-api


text:
Implement optimized CachingNativePriceEstimator

Related: #1615
Opened to replace #1619 & #1622
Added a new component which has been optimized to cache native price estimates and allows us to improve cache maintenance more easily than a solution composed from existing components.
The plan is to use this component in a second price estimator hierarchy which only ever estimates native prices.
The cache is unbounded in size and has a max age for the cached prices.
Price estimates resulting in a PriceEstimationError don't get cached.
The underlying cache is protected by a RwLock to keep latency low when multiple user need price estimates at the same time.
The provided maintenance strategy can be configured to run at any interval and to update every or at most n outdated prices at once per update cycle.
Test Plan
New unit tests

Codecov Report

Merging #1626 (9eeeb6d) into main (cfcc240) will increase coverage by 0.24%.
The diff coverage is 92.80%.

@@            Coverage Diff             @@
##             main    #1626      +/-   ##
==========================================
+ Coverage   66.59%   66.84%   +0.24%
==========================================
  Files         172      173       +1
  Lines       33748    33989     +241
==========================================
+ Hits        22476    22721     +245
+ Misses      11272    11268       -4

source: gharchive/pull-request

authors: MartinquaXD codecov-commenter


text:
#99 Refactor redux store

In this PR:

Update dependencies
Update README.MD to use yarn since we use yarn on our ci and IMO it's better to keep it the same everywhere
Rewrite logic for saving active tokens: now active tokens are calculated for all safes inside src/routes/safe/store/middleware/safeStorage.js:24. This was kind of required by the next change I'll describe
Remove duplication of tokens inside redux store:
Previously tokens state looked like this:

  tokens: {
    safeAddress: list of active tokens for the safe + list of tokens from relay
}

now it's just
  tokens: {
    tokenAddress: token
  }

and activeTokens for each safe are stored on Safe's state in activeTokens array

Add array of token balance on safe's object. Again, in previous state since we stored tokens for each safe the token had balance property on it. Since it's not the case anymore, Safe now has an array with token balances
Tokens modal logic: calculate current active tokens on modal mount, and before it unmounts dispatch an action to update safe's active tokens / fetch balances. Because a user can toggle token activity and previously it'd fetch token's info every update, it caused selectors to recalculate and also produced a lot of network requests. To optimize that, I implemented the logic I describe above (thanks Andre for the idea :))
Fix updateSafe action: previously for updating a safe you can to create safe again, fetch all the info, update the  property and then pass a new safe to the reducer. Otherwise It'd create a safe with initial values and overwrite the safe in store with them. Now it can accept a single prop update and the logic is handled in the reducer
Remove sessionStorage and cookieStorage from immortalDB used storage's list because of these potential issues:
https://github.com/gruns/ImmortalDB/issues/22
https://github.com/gruns/ImmortalDB/issues/6

OPTIMIZATION IDEA
Currently it saves safes/tokens to local storage on each UPDATE_SAFE and ADD_SAFE actions. I think maybe it do it right before the app window is closed? So the storage is not bombed with updates every 10-15 seconds. I need to do some research about this approach. Would love to hear your opinion you have done something like that :)

Travis automatic deployment:
https://pr103--safereact.review.gnosisdev.com
Storybook book automatic deployment:
https://pr103--safereactstorybook.review.gnosisdev.com

Travis automatic deployment:
https://pr103--safereact.review.gnosisdev.com
Storybook book automatic deployment:
https://pr103--safereactstorybook.review.gnosisdev.com

Answering to your question on the OPTIMIZATION IDEA, it looks good to me. Just remember that the user could also refresh the app, so that should be handled too.

Users visiting the app for the first time, when storage is empty, will get this error in the console:

Travis automatic deployment:
https://pr103--safereact.review.gnosisdev.com
Storybook book automatic deployment:
https://pr103--safereactstorybook.review.gnosisdev.com

Travis automatic deployment:
https://pr103--safereact.review.gnosisdev.com
Storybook book automatic deployment:
https://pr103--safereactstorybook.review.gnosisdev.com

authors: germartinez gnosis-info mikheevm

repo: gnosis/safe-react


text:
Change registration endpoint behaviour

What is needed?
Every signer sent CAN be an owner of any number of Safes. If not, all the valid signers must be inserted in database and a warning about the invalid ones should be returned.
Background
Currently every signer sent MUST be an owner of at least one Safe and a error is sent if they are not.

@gnosis/safe-android @gnosis/safe-ios
Endpoint behaviour has been changed:

Addresses that don't belong to any Safe will be ignored, the rest will be inserted.
There are now 2 new fields in the return object, ownersRegistered and ownersNotRegistered, they both are a list (can be empty) of ethereum checksummed address.

@Uxio0 , checked on staging . It works with non-owners

repo: gnosis/safe-transaction-service


text:
Send message on event

I currently developing a bot that monitor a websocket and forward messages received to a channel. Your library looks great to does this task and will allow to add more feature but the issue I get with is I don't find how to send a message without being into the context of a command most of the method to do that are a not exported. I would like to know if you have any idea how I can achieve this into a plugin?

Hello @ricksancho, thanks for the interest in this project.
Right now this is not supported, I'll think about the best way to implement that in the near future.
I thought about tricking the bot to execute your plugin using the MessageReceived method, something like:

Write a plugin that responds to a certain command, ex: !forward_msg
Write your websocket handler
Call botInstance.MessageReceived("#channel", "!forward_msg your message", &bot.User{Nick: "Sender Nickname"})

But that would not work, as the bot instance is private in the protocol implementation.

Thanks @fabioxgn, call on MessageReceived with some kind of echo plugin was my first idea, but I come to same conclusion, that would not work due to private instance. I was lacking of idea too on how to patch this nicely and just finish by creating a new bot for this task only (just fwd the websocket message to channel with an irc lib).
If I have spare time I will try to come up with a solution.

I'm actually interested in this as well - if I understand things correctly this would also enable cross-network chatter, ie, have a Telegram bot notify me on certain events / commands from IRC. I suppose you could run several networks in one bot using goroutines and have a channel or mutex for cross-talk, but I'm not exactly sure. I'm pretty new to Go, so there could be a better / more elegant way to handle it.
Either way, in both cases it's a matter of "injecting events in a running stream", right? If not, I'll open a separate issue.

@doenietzomoeilijk yes, somehow it would, but right now each protocol runs on a different bot instance, to to cross chat I think that the easiest way is to make some events public on the bot and then write some kind of router which will receive all the messages from all instances and forward them to the other instances.
It is not impossible to do but will require some work.

@fabioxgn The way I was thinking of - and I'm in no way sure that it's possible, or the best way - was using several goroutines in one bot instance, like so:
func main() {
	go slack.Run("my-slack-token")
	go telegram.Run("my-telegram-token")
	go irc.Run(myIrcConfig)
}

Would that work, or does that create more problems than it solves? Adding a channel argument to the respective Run methods would allow you to use one channel across all networks, I think, similar to this example.
Just thinking out loud, and as I said, I'm new to Go so I could very well be missing some obvious things. :)

@doenietzomoeilijk that will work, it is exactly like that that I run my own bot in production, as you can see here:
https://github.com/fabioxgn/go-bot-heroku/blob/master/main.go#L35
You just can't run the last one in a goroutine or the program will exist, either you wait something or run one of them in the main loop as I do.

@fabioxgn Ah, good to know I wasn't completely off, then. So would creating a channel before starting all the bots, and then providing that as an extra argument to all of them work? Can you "use" a channel from a "regular" routine, in your case the Slack one?

@doenietzomoeilijk yes, it will work, btw that's the way channels are ment to be used, see: https://gobyexample.com/channels

@fabioxgn Excellent, so then all we need is a mechanism for one bot runner to send data to another bot runner, either directed (an IRC bot that explicitely targets the Slack bot running in the same instance) or as a general queue (an IRC bot that stuffs something into a "cross-instance" channel, for the other channels to maybe act upon). However, that requires each bot to know what type it is, and to make that known to plugins so they can act on certain actions on certain network types, but not on others. Alternatively, you'd have to be able to hook up certain plugins to certain bot only, so for example my IRC bot gets catgifs and chucknorris, and my Slack bot gets chucknorris and godoc. Either option has pros and cons, what's your thoughts?

@doenietzomoeilijk The most complicated part is which channel to send the messages to, I think that the implementation will have to solve this either fixing a channel on startup on dispatching a message to the other protocol and the receiver will have to know in which channel to post to.

@fabioxgn Channel as in chat channel or as in go communication channel?

@doenietzomoeilijk chat channel.

OK, gotcha. And yes, you need to know which bot+channel you need to send to. I'm currently somewhat running into this with the quotes-script - I want to keep all the quotes in one database, but keep all the channels apart. That'd be a tad easier if, at command time, I had at least the network type (irc|slack|telegram), and possibly even more info (if I have two IRC bots running I still want to be able to tell apart the two connections).
How open are you to adding more info to the Cmd struct? (And on that note, what's struct incomingMessage for? I don't see it used anywhere?)

@doenietzomoeilijk maybe the correct way to handle this is instead of running multiple bot instances, allow one instance to run several protocols, this will require some major refactorings in the end I think it's the correct way to do.
I run mutiple instances of the bot as it was the easiest thing to do, but when you start adding complexity I think that it's better to do it correctly now than regret it later.
About the incomingMessage I think it is some leftover from a previous version, it is not used.

I'll see what I can come up with in terms of ideas. For now my bot theoretically is limited to IRC anyway, so I want to focus on getting that done; refactorings and multi-network can come after that.

I'm closing this issue as I think there's nothing to be done for now.

authors: doenietzomoeilijk fabioxgn ricksancho

repo: go-chat-bot/bot

license: mit

license_source: bigquery


text:
update frequency type to float64, reduce type conversion

update frequency type to float64, reduce type conversion and make type same
remove float64 type conversion

Codecov Report

Merging #36 into master will increase coverage by 0.01%.
The diff coverage is 93.75%.

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   90.78%   90.79%   +0.01%
==========================================
  Files           9        9
  Lines         640      641       +1
==========================================
+ Hits          581      582       +1
  Misses         44       44
  Partials       15       15

Impacted Files
Coverage Δ

dictionary.go
85.96% <83.33%> (+0.25%)
:arrow_up:

dag.go
93.37% <100.00%> (ø)

dict_util.go
94.15% <100.00%> (ø)

token.go
87.50% <100.00%> (ø)

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 b031ae9...0d903c5. Read the comment docs.

authors: codecov-commenter vcaesar

repo: go-ego/gse


text:
Change location of respositories on file system

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

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

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

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

Log gist:

Description
This should be a simple fix, but I am banging my head trying to change the default repository location to a separate partition. I though this would be as simple as changing the default location of ROOT = /var/lib/gitea/repos in /etc/gitea/appp.ini to the desired folder, but doing so gives me a 500 error whenever I try to create a new repo. I've also tried using a symbolic link from /var/lib/gitea/repos --> /new_partition/repos but this doesn't work either. I've made sure the owner & group are both gitea, along with the correct permissions, but no luck.
Is there something I'm missing here, such as another setting in app.ini I need to change?

just look at the docs :)
-> https://docs.gitea.io/en-us/config-cheat-sheet/#repository-repository
[repository]
ROOT = /data/repos

@dsmaynard if you have more questions how to setup - just as on discord

Like I said, I tried changing the ROOT to a new folder (using an absolute path), and I get an error when trying to create a repository. The only ROOT variable that allows me to create new repose is /data/repos.

Can you provide some logs from around the time of the 500 error?
As well, did you restart Gitea after changing the config?

After making changes I just issue the standard # systemctl restart gitea.service to save the changes, which seems to work as the log registers the changes to the ROOT directory.
Here's the output of log, noting the permissions issue:
2020/02/10 17:42:38 models/repo.go:1452:CreateRepository() [E] initRepository: InitRepository: mkdir /run/media/myarch/part_2: permission denied 2020/02/10 17:42:38 routers/repo/repo.go:149:handleCreateError() [E] CreatePost: delete repo directory jsmith/test_repo failed(2): open /run/media/myarch/part_2/gitea_repos/jsmith: permission denied
Currently the r/w permissions are set to 755, and the group/owner for /run/media/myarch/part_2/ is set to gitea:gitea, as are all subdirectories/files. Is there a different owner I need to be using?

Is that the same as the user running Gitea in the systemd unit?

I'm just following the owner and permissions for /var/lib/gitea/repos, which are owner = gitea, and permissions are 755, if that's what you mean.

/run/media/myarch/part_2/gitea_repos/jsmith

Is this on a permanent disk?
Try getting us the output of:
ps -ef | fgrep gitea
ls -ld /run/media/myarch/part_2/gitea_repos/jsmith
df -h /run/media/myarch/part_2/gitea_repos/jsmith

This is a mounted ssd. Here's are the output of the commands (note the change in the mount point from the previous posts)
$ ps -ef | fgrep gitea gitea      62078       1  0 09:53 ?        00:00:00 /usr/bin/gitea web -c /etc/gitea/app.ini jsm        62227   60903  0 09:55 pts/8    00:00:00 grep -F gitea $ ls -ld /mnt/backup/gitea_repos/ drwxr-xr-x 2 gitea gitea 4096 Feb 10 17:38 /mnt/backup/gitea_repos/ $ df -h /mnt/backup/gitea_repos/ Filesystem      Size  Used Avail Use% Mounted on /dev/sda1       916G  3.8G  866G   1% /mnt/backup

A couple things you could do:

Make sure /, /mnt and /mnt/backup are searchable by the gitea user, normally via the other permissions group.
Impersonate the gitea user (su - gitea to ensure no credentials remain from your starting user) and manually try to create a file or folder in /mnt/backup/gitea_repos/.
As root, do: chown -R gitea:gitea /mnt/backup/gitea_repos/ (assuming the group is also called gitea).
Finally, perform mount | fgrep /mnt/backup to check whether the file-system is mounted read-only or with some special flag I can't think of ATM.

@dsmaynard witch filesystem has the external disc - just an iteresting question witch come in my mind...

One more thing: make sure the new disk is mounted before Gitea starts.

reopen

repo: go-gitea/gitea


text:
Display SVG respecting viewbox

Gitea version (or commit ref): 1.4.0

Description
#14101 it's a very nice feature. But it's display on full webpage. Could be possible to display them respecting their viewbox ?
Sample
https://git.spip.net/spip/spip/src/commit/195ea6651e848bd36b6823e6419d20869e391b13/prive/themes/spip/images/article-new-16.svg is displayed on full screen but it's an icon and should be proposed on 64x64 size.
Thanks

Or we can have zoom in/zoom out

yes could be nice to zoom in/out from viewport as default size

viewboxis not for dimensions. Try adding width and height to the <svg> tag and I imagine it would display in the proper size.

Some research on the GH renderer:

SVG without width/height always render at 300px width/height (letterboxed I assume).
SVG with width/height render at those dimensions but capped at 600px width/height.

\o/

authors: camlafit lunny silverwind


text:
How to store/create/access global pre-receive hooks?

Tried adding a hooks folder in the gitea-repositories folder (separate to the one within repos), and using:
git config --global core.hooksPath <path/to/hooks>
but that didn't work. Tested adding server side hooks to the hook folder within the repo and those work, but I'm looking for a solution to have the hook be present in all repo within the gitea server.
Also, is there an easy way to push hooks to the gitea server from within a local repo? Have the server hosted within kubernetes, making it pretty difficult.
Thanks!

You can set the DISABLE_GIT_HOOKS option to false and then the admin will get a nice UI to add hooks.
Regarding core.hooksPath we want to use that in future to take complete control of hooks within gitea, so you would likely have found that breaking at some point.

authors: Chewibub zeripath


text:
Fix pull request commit list item positions

I dont know if there is issue related this
Before

After

Is there an example of this on try.gitea.io? Clearfix seems so oldschool, I wonder of there are better solutions.

@silverwind https://try.gitea.io/jaqra/changelog/pulls/1

looks like this happens because of float rules

It gets better with signed commits 😂
https://try.gitea.io/jolheiser/normal/pulls/1

@jolheiser actually this looks like so artistic. maybe we should NOT fix this 😜

Hmm, not seeing it in either Firefox or Chrome:

Chrome 84.0.4147.105 (64 bit)

Weird, macOS Chrome 84.0.4147.105 renders it fine. Such issues are usually not platform-specific.

This change does regress vertical centering on the element for me and also increase element height by 2 px. I don't think it's right.
Before:

After:

Interesting -- can't reproduce this either on macOS in any browser

Have you customerized your gitea's css?

Something interesting to note, checking now on my Linux machine, same browser as before (Brave), it looks just fine.
My earlier test was on Windows.

@lunny i did not customize gitea's css. i can reproduce also in try
this should be chrome's issue for windows build. because there is one more thing https://gitea.com/gitea/changelog/pulls/44

I can try on Windows later but ultimately I think we should flexbox these timeline messages instead of adding extending the float hacks further.

@silverwind  I dont know best practices for flex boxes but i will try

Basically you want a horizontal flexbox with spacing between, e.g.

.timeline-entry {
  display: flex;
  justify-content: space-between;
}

This should give a basic layout that works. CSS-based text truncation may be needed on the left element. Or if the server already does it, that's fine too.

Can not reproduce on Chromium 84.0.4147.89 on Windows

@CirnoT this should be new in Chrome 84.0.4147.105

Maybe report it to https://bugs.chromium.org/p/chromium/issues.

Just to say I'm not seeing the original problem on: Chrome linux 84.0.4147.105 (Official Build) (64-bit)

If no one can reproduce, maybe it's a extension or something interferring?

I tried on clean browser. Is there anyone using windows 10 google chrome 84.0.4147.105

Just tried that exact browser/os and still cannot reproduce. Version 84.0.4147.105 (Official Build) (64-bit). Update graphics drivers perhaps?

@silverwind  i have 2 laptops. I can reproduce on both

@jaqra 84.0.4147.105 a6b12dfad6663f13a7e16e9a42a6a4975374096b-refs/branch-heads/4147@{#943} (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36), can not reproduce. If this started happening after updating to .105 then I strongly advise opening bug reporting with Chromium, breaking changes in CSS are not supposed to happen in patch releases for Chromium.

@lunny i did not customize gitea's css. i can reproduce also in try
this should be chrome's issue for windows build. because there is one more thing https://gitea.com/gitea/changelog/pulls/44

Interestingly this looks solved. This is not broken now

But commit positions is still broken

Feel free to close this pr if no one can reproduce

The misaligned reactions may be an effect of https://github.com/go-gitea/gitea/pull/12317/files but I did not observe it. It certainly made them a bit smaller (1.25em vs previous 1.5em)

@silverwind this screenshots are from gitea.com. yesterday and today. i guess gitea.com did not upgrade

gitea.com is at https://github.com/go-gitea/gitea/commit/e67c04251 so should have that PR.

This has started happening for me recently, don't really feel like bisecting which commit broke it explicitly, but the actual reason for this happening is that the spacing between two singular-commit elements is too low and the icon itself is bigger than it looks (it has invisible background) causing it to overflow.

This should have been resolved.

looks problem resolved. i am closing this

authors: CirnoT jaqra jolheiser lunny mrsdizzie silverwind zeripath


text:
Ordering organizations and users by name

Relative to the issue #3845 and #49, this Pull Request add modifications to ordering by name Organizations and User Accounts.
It's more user friendly and make search more easy when organizations and user accounts are ordered by name rather than last update datetime.
I added new function GetUsersByIDs to decrease the number of SQL queries by using IN predicate rather than just running 1 SQL query per users.

Current coverage is 3.13% (diff: 0.00%)

Merging #130 into master will decrease coverage by <.01%

@@            master      #130   diff @@
========================================
  Files           33        33
  Lines         7823      7841    +18
  Methods          0         0
  Messages         0         0
  Branches         0         0
========================================
  Hits           246       246
- Misses        7557      7575    +18
  Partials        20        20

Powered by Codecov. Last update 145648a...848273e

Current coverage is 3.13% (diff: 0.00%)

Merging #130 into master will decrease coverage by <.01%

@@            master      #130   diff @@
========================================
  Files           33        33
  Lines         7823      7841    +18
  Methods          0         0
  Messages         0         0
  Branches         0         0
========================================
  Hits           246       246
- Misses        7557      7575    +18
  Partials        20        20

Powered by Codecov. Last update 145648a...3a10a0c

LGTM

LGTM

It seem something goes wrong. I get a err 500 on Gitea "Commits" page. Maybe Github issue.

authors: 0xbaadf00d codecov-io lunny strk


text:
Changelog v1.13.4 (#14917)

Frontport #14917

:rocket:


text:
Don't require team membership for team search results

Another regression from #18518.
Note that tests for other routes expect non-team-members not to have access to it:

https://github.com/go-gitea/gitea/blob/4aafe26007b51e806bd9529870def18223bc18f5/tests/integration/api_team_test.go#L42
https://github.com/go-gitea/gitea/blob/79224316ae7db8cbdcf577a512e27ff4e8033ead/routers/web/org/teams.go#L342

But I'd argue this assumption breaks the quite valid use-case of searching for teams you are not a member of.
Also the /api/v1/orgs/{org}/teams endpoint (available to org members)  will happily list all existing teams, so there is some inconsistency here already. I'd say you don't need to be team member to see details, as the information gained is not exactly sensitive.
related discussion for permissions in the frontend:

#20844
https://github.com/go-gitea/gitea/issues/20658

CI failure is related.

as the information gained is not exactly sensitive.

		apiTeams[i] = &api.Team{
			ID:                      teams[i].ID,
			Name:                    teams[i].Name,
			Description:             teams[i].Description,
			IncludesAllRepositories: teams[i].IncludesAllRepositories,
			CanCreateOrgRepo:        teams[i].CanCreateOrgRepo,
			Permission:              teams[i].AccessMode.String(),
			Units:                   teams[i].GetUnitNames(),
			UnitsMap:                teams[i].GetUnitsMap(),
		}

Which information is exactly needed, maybe we could limit it to just the necessary fields? I do find this to be quite "senstive" as it laids out the whole team structure in a organization.

I'm sorry @noerw for the late reaction, I'm pretty sure I was misunderstanding this code and situation. Limiting the return results to Name + Description is fine IMO.

replaced by #20844

authors: Gusted lunny noerw


text:
Update go dependencies and fix go-git (#28893)

Backport #28893

This is a backport, maybe it's not suitable to have a claim.

sure removed
I just noted out that i do spent it in my work hour :)

I think this cases i just make the disclame (for transparency) in a extra comment :)


text:
Change parsing of postgresql settings

Fix #4200

Codecov Report

Merging #4275 into master will not change coverage.
The diff coverage is 0%.

@@           Coverage Diff           @@
##           master    #4275   +/-   ##
=======================================
  Coverage   19.97%   19.97%
=======================================
  Files         153      153
  Lines       30523    30523
=======================================
  Hits         6097     6097
  Misses      23512    23512
  Partials      914      914

Impacted Files
Coverage Δ

models/models.go
29.18% <0%> (ø)
:arrow_up:

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 69bfd81...cfa259d. Read the comment docs.

@techknowlogick could you add some tests?

@lunny I don't see how tests could be added for this

@lafriks / @lunny I could create a new function (similar to parsePostgreSQLHostPort) for generating postgres connection strings and test various variables for that.
I have a couple of hours until I can get started on that, but that's what I was thinking. Let me know what you think.

I pushed the function and now this is still pending tests.

Ok. Tests added, and I know this already has 2 LG-TM, but I will wait for another merger/owner to merge this.

authors: codecov-io lafriks lunny techknowlogick


text:
Use native go method to get current user rather than environment variable

Fixes #1640, #4894
Native "os/user" go package has good function to retrieve current user, rather than relying on USER environment variable.
If getting current user doesn't work on target OS (for example, not yet implemented for it) - it falls back to old implementation with environment variables.
Unit test also changed, old one won't work because USER environment variable spoofing doesn't work anymore (unless os/user is not implemented for OS under which tests are run), now it just compares CurrentUser() with whoami command output (skipped on Windows where whoami behaves different way).
For Windows OS with "domain\username" format, only second part (username) is returned to match previous behavior and trim unnecessary prefix.

Blocked until 1.6.0-rc1 is released

Codecov Report

Merging #4930 into master will increase coverage by <.01%.
The diff coverage is 27.27%.

@@            Coverage Diff            @@
##           master   #4930      +/-   ##
=========================================
+ Coverage    37.4%   37.4%   +<.01%
=========================================
  Files         306     306
  Lines       45378   45389      +11
=========================================
+ Hits        16974   16980       +6
- Misses      25949   25954       +5
  Partials     2455    2455

Impacted Files
Coverage Δ

modules/user/user.go
23.52% <27.27%> (-76.48%)
:arrow_down:

models/repo_list.go
63.37% <0%> (+1.16%)
:arrow_up:

models/repo_indexer.go
52.11% <0%> (+2.54%)
:arrow_up:

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 637c5fe...1ea5eea. Read the comment docs.

authors: SagePtr codecov-io lafriks


text:
Fix LFS Locks over SSH

Whilst looking at adding more tests for #6993 I've noticed that LFS locking was not-preauthenticating  correctly over SSH.
This PR fixes this.
Fixes #3084

It seems there is an issue reported that.

@lunny do you know which issue it is because I can't seem to easily find it.

Maybe it is https://github.com/go-gitea/gitea/issues/5478

It's possible that this is part of the fix for that, but I think #6993 is probably more likely to fix that.
I'm going to incorporate this in #6993 in any case.

Codecov Report

Merging #6999 into master will decrease coverage by 0.01%.
The diff coverage is 54.32%.

@@            Coverage Diff             @@
##           master    #6999      +/-   ##
==========================================
- Coverage   41.44%   41.42%   -0.02%
==========================================
  Files         441      441
  Lines       59696    59746      +50
==========================================
+ Hits        24739    24750      +11
- Misses      31732    31766      +34
- Partials     3225     3230       +5

Impacted Files
Coverage Δ

routers/routes/routes.go
82.68% <100%> (ø)
:arrow_up:

modules/lfs/locks.go
48.59% <53.75%> (+1.35%)
:arrow_up:

models/lfs_lock.go
56.81% <0%> (-6.82%)
:arrow_down:

models/unit.go
62.16% <0%> (-5.41%)
:arrow_down:

models/error.go
31.86% <0%> (-1.54%)
:arrow_down:

routers/repo/view.go
42.02% <0%> (-1.02%)
:arrow_down:

modules/lfs/server.go
45.16% <0%> (+0.74%)
:arrow_up:

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 8de76b6...8b320fa. Read the comment docs.

@sapk have you been able to test this yet? git_test.go does test the locking now btw.

@zeripath not much time to do so lately. So if someone other validate it should be good as my requested changes are done.

@zeripath  I think this should resolve #7219, could you send back port to v1.8 .

authors: codecov-io lunny sapk zeripath


text:
Default NO_REPLY_ADDRESS to DOMAIN

The default NO_REPLY_ADDRESS was previously noreply.example.org
This PR changes this to default to the default DOMAIN for gitea.
Fixes #9275

This may not be the completely correct thing to do as it potentially just reveals the user's email.

If the persons email address is also their username@domain then it would defeat the purpose.
It also sounds like the linked issue expects this to be resolved by having the private address be noreply@domain but Gitea still uses the username in  a 'private address' so I think just setting NO_REPLY to DOMAIN causes a new problem and probably doesn't actually fix what the person in that issue wants or expects (to have the address end up as noreply@domain when private).
I think part of the confusion is this uses a bad variable name -- it sounds like the issue reporter expects NO_REPLY_ADDRESSto be an actual full/single e-mail address that will be used in all cases. Of course, it is just a domain name that is used in building the address. So their issue is that they think NO_REPLY_ADDRESSshould be the address noreply@domain when it really isn't an address at all.

Codecov Report

Merging #9325 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master   #9325      +/-   ##
=========================================
- Coverage   41.21%   41.2%   -0.01%
=========================================
  Files         559     559
  Lines       73116   73116
=========================================
- Hits        30133   30128       -5
- Misses      39207   39211       +4
- Partials     3776    3777       +1

Impacted Files
Coverage Δ

modules/setting/service.go
80.76% <100%> (ø)
:arrow_up:

modules/log/file.go
75.52% <0%> (-2.1%)
:arrow_down:

models/repo_list.go
73.14% <0%> (-0.93%)
:arrow_down:

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 3bf5a07...0b5a09e. Read the comment docs.

@mrsdizzie that's what I meant by it being not necessarily the correct thing.
I would say that this does at least hide the private email address if they're not in the current domain - however the current system private email system isn't very good at hiding emails in the case that their email address is username@domain in any case as you can easily back generate that from the NO_REPLY_ADDRESS email as username@NO_REPLY_ADDRESS -> username@domain.
Yeah I agree the configuration name is poorly named - I think even gitea.com had it wrong at some point.
The email address should probably be user-:userid:@NO_REPLY_ADDRESS

Agree this is all confusing and also conflating two separate ideas: a 'private' address and an address that indicates via its name that you shouldn't/can't reply to it because it isn't valid.
I think the address it self should be invalid and indicate no reply by default since it is likely the domain name will have also valid MX records. The default now doesn't have valid MX records and can't have mail sent to it which I think is correct.
Say gitea.com/domain has a catch-all enabled and now it makes every 'private' address a valid one that will accept and deliver mail to somewhere.
Or say you have an existing email address zeripath@gitea.com and I sign up for the username zeripath on gitea.com and mark as private and now all my commits say zeripath@gitea.com.
It seems that just using a combination of username + domain name will cause more potential problems then it fixes. I'm also not sure it qualifies as a noreply address if it can actually work and have mail sent to it in any case. Maybe that is just more trouble of trying to combine noreply and private.
Perhaps defaulting to noreply.domain would solve some of that or provide a better default.

In think this is also what the linked issue is requesting as well, just reversed. They expect it to be noreply@domain (which is presumably invalid).

@mrsdizzie yeah I think that that is more correct. I've changed it to default to noreply.DOMAIN

authors: codecov-io mrsdizzie zeripath


text:
v2 版本 need to define a valid foreign key for relations or it need to implement the Valuer/Sc anner interface

type MenuInListStruct struct { 	Id                int64 json:"id"	Title             stringjson:"title" remark:"菜单名称"	MenuType          int   json:"menu_type" remark:"菜单类型：分为模块、菜单、操作，默认是菜单"	MenuOperatingType int   json:"menu_operating_type" remark:"操作类型"	Api               stringjson:"api" remark:"连接地址"	Path              stringjson:"path" remark:"连接地址"	Sort              int64 json:"sort" remark:"连接地址"	ParentId          int64 json:"parent_id" remark:"上级菜单"	Icon              stringjson:"icon" remark:"icon图标"`
}
type MenuInListTreeStruct struct {
MenuInListStruct
Children []*MenuInListTreeStruct
}
// types 是判断是否取出菜单
func MenuInList(ids string, types bool) ([]*MenuInListTreeStruct, error) {
var Lists []*MenuInListTreeStruct
model := Orm.PGDB.Table(MenuTable).Select("id,title,api,path,menu_type,menu_operating_type,parent_id,sort").Where("id in (" + ids + ")").Where("status = 1")

if types == true {
	model = model.Where("menu_type = 2")
}

err := model.Order("id desc").Find(&Lists).Error
if err != nil {
	return nil, err
}
return Lists, err

}
`
我指定了 要取出的字段，现在报 下面的错误！
invalid field found for struct models.MenuInListTreeStruct's field Children, need to define a valid foreign key for relations or it need to implement the Valuer/Scanner interface
请解答一下，非常感谢！！！！！

你好，怎么解决的

repo: go-gorm/gorm


text:
Is there a way to do batch upsert while ignoring zero values?

Your Question

When using Upsert/On-Conflict with AssignmentColumns, it will replace the given values in the columns even if they are zero-valued.
If my batch updates are mixed (each struct may have different zero value fields that I don't want to update), is that supported by the upsert/on-conflict?
type MyModel {
    ID int
    a int
}

// For the sake of the example, lets say both of these entities already
// exist in the DB and their `a` value is 3.
updates := []MyModel {
    { 1, 5 }, // I want this to update to 5
    { 2, 0 }, // I don't want this update to 0
}

_ := d.DB.Clauses(clause.OnConflict{
		Columns: []clause.Column{
			{Name: "a"},
		},
		DoUpdates: clause.AssignmentColumns([]string{"a"}),
	}).Create(&updates)
// `a` will be 0 for the second struct

The document you expected this should be explained

Expected answer

no, it is not possible.

authors: dgunay jinzhu


text:
[Discussion] Performance Difference between redis-benchmark and go-redis

I was doing a performance comparison between redis-benchmark and toy web app using go-redis.
My web app code looks like below:-
package main

import (
        "fmt"
        "github.com/buaazp/fasthttprouter"
        "github.com/valyala/fasthttp"
        "gopkg.in/redis.v5"
        "log"
        "net/http"
        "time"
)

var client *redis.ClusterClient
var sha1 string

const script = `if redis.call("EXISTS", KEYS[1]) == 1 then
    local keyvalues = redis.call("HGETALL", KEYS[1])
    local a = {}
    for i=2, table.getn(ARGV) do
      a[i-1] = ARGV[i]
    end
    local res = redis.call("HMSET", KEYS[1], unpack(a))
    redis.call("EXPIRE", KEYS[1], ARGV[1])
    return keyvalues
else
    return 2 -- "Key doesn't exists"
end`

func initRedis() {
        opts := redis.ClusterOptions{
                Addrs:        []string{"172.16.84.120:7009","172.16.84.114:7008","172.16.84.118:7008","172.16.84.112:7008","172.16.84.118:7009","172.16.84.120:7008","172.16.84.114:7009", "172.16.84.112:7012", "172.16.84.114:7011"},
                PoolSize:     6000,
                PoolTimeout:  30 * time.Millisecond,
                DialTimeout:  1 * time.Second,
                ReadTimeout:  20 * time.Millisecond,
                WriteTimeout: 20 * time.Millisecond,
                IdleTimeout:  5 * time.Second,
        }
        client = redis.NewClusterClient(&opts)
        sha1 = client.ScriptLoad(script).Val()
        fmt.Printf("\nScript SHA %s", sha1)
}

func Index(ctx *fasthttp.RequestCtx) {
        keys := []string{"JJNc46a7473c1e511e6971b0242ac11009c1481710326G"}
        argv := make([]interface{}, 5)
        argv[0] = 30000
        argv[1] = "SSF_lastAccessedDate"
        argv[2] = 1481627386
        argv[3] = "SSF_expiryDate"
        argv[4] = 1481657386
        res, err := client.EvalSha(sha1, keys, argv...).Result()
        if err != nil {
                fmt.Fprint(ctx, err.Error()+"\n")
                log.Println(err.Error());
                ctx.Response.SetStatusCode(http.StatusInternalServerError)
        } else {
                fmt.Fprint(ctx, fmt.Sprintf("%+v\n", res))
                ctx.Response.SetStatusCode(http.StatusOK)
        }

}

func main() {
        initRedis()
        router := fasthttprouter.New()
        router.GET("/", Index)
        log.Fatal(fasthttp.ListenAndServe(":7890", router.Handler))
}

I used vegeta to do a load test. The command used:-
echo "GET http://localhost:7890/" | ./vegeta attack -rate=10000 -duration=60s -timeout=20s | tee results.bin | ./vegeta report
But when I set -rate=20000 I started seeing lot of errors from go-redis like below:-
2016/12/14 18:33:32 MOVED 8618 172.16.84.112:7012
2016/12/14 18:33:32 MOVED 8618 172.16.84.112:7012
2016/12/14 18:33:32 read tcp 172.16.84.106:54833->172.16.84.112:7012: i/o timeout
2016/12/14 18:33:32 read tcp 172.16.84.106:54788->172.16.84.112:7012: i/o timeout
2016/12/14 18:33:32 read tcp 172.16.84.106:59175->172.16.84.112:7012: i/o timeout
2016/12/14 18:33:32 dial tcp 172.16.84.112:7012: i/o timeout
2016/12/14 18:33:35 EOF
2016/12/14 18:33:35 EOF
2016/12/14 18:33:35 EOF
2016/12/14 18:33:35 EOF
2016/12/14 18:33:35 EOF
2016/12/14 18:33:35 EOF

When I tried to replicate the same test using redis-benchmark I am getting about 30K req/sec:-
debraj@artemis-new-api1:~/redis-stable/src$ ./redis-benchmark -h 172.16.84.114 -p 7011 -n 100000 -c 100 evalsha 828a661307907883c9390fcb510c6227b7a4e536 0
====== evalsha 828a661307907883c9390fcb510c6227b7a4e536 0 ======
  100000 requests completed in 3.44 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

0.00% <= 1 milliseconds
0.55% <= 2 milliseconds
42.64% <= 3 milliseconds
82.07% <= 4 milliseconds
98.76% <= 5 milliseconds
99.64% <= 6 milliseconds
99.88% <= 7 milliseconds
99.90% <= 8 milliseconds
99.90% <= 17 milliseconds
99.92% <= 18 milliseconds
99.96% <= 19 milliseconds
99.97% <= 20 milliseconds
99.98% <= 21 milliseconds
100.00% <= 21 milliseconds
29095.14 requests per second

The steps followed in ./redis-benchmark:-

Connected to a redis master node and executed the below command:-

172.16.84.114:7011> script load "local KEYS = {'JJNc46a7473c1e511e6971b0242ac11009c1481710326G'} local ARGV = {30000, 'SSF_lastAccessedDate', 1481627386, 'SSF_expiryDate', 1481657386} if redis.call('EXISTS', KEYS[1]) == 1 then local keyvalues = redis.call('HGETALL', KEYS[1]) local a = {} for i=2, table.getn(ARGV) do a[i-1] = ARGV[i] end local res = redis.call('HMSET', KEYS[1], unpack(a)) redis.call('EXPIRE', KEYS[1], ARGV[1]) return keyvalues else return 2 end"
"c38146b686355aef11cbd54beea17896cb98e561"

Then executed:-
./redis-benchmark -h 172.16.84.114 -p 7011 -n 100000 -c 100 evalsha 828a661307907883c9390fcb510c6227b7a4e536 0

Can some one explain me why there is so much performance lag between redis-benchmark and go-redis?

Looks like you are comparing HTTP server + go-redis against redis-benchmark? You should get rid of HTTP server to get meaningful comparison.

Yeah.
But if you see the error it is coming from go-redis with lot of i/o timeout this is not related to HTTP. But for redis-benchmark I am not seeing any i/o timeout.
2016/12/14 18:33:32 read tcp 172.16.84.106:54833->172.16.84.112:7012: i/o timeout
2016/12/14 18:33:32 read tcp 172.16.84.106:54788->172.16.84.112:7012: i/o timeout
2016/12/14 18:33:32 read tcp 172.16.84.106:59175->172.16.84.112:7012: i/o timeout
2016/12/14 18:33:32 dial tcp 172.16.84.112:7012: i/o timeout

Okay, then you probably have to add HTTP server to redis-benchmark. Just so we can be sure that HTTP server really does not matter.

with lot of i/o timeout this is not related to HTTP

It can't be true.

If we look at the code that I have used for the test:-
res, err := client.EvalSha(sha1, keys, argv...).Result()
        if err != nil {
                fmt.Fprint(ctx, err.Error()+"\n")
                log.Println(err.Error());
                ctx.Response.SetStatusCode(http.StatusInternalServerError)

The error I am seeing in console:-
2016/12/14 18:33:32 read tcp 172.16.84.106:54833->172.16.84.112:7012: i/o timeout
2016/12/14 18:33:32 read tcp 172.16.84.106:54788->172.16.84.112:7012: i/o timeout
2016/12/14 18:33:32 read tcp 172.16.84.106:59175->172.16.84.112:7012: i/o timeout

These i/o timeout are coming from go-redis.

I repeated the same test by taking out http. Below is the code:-
package main

import (
	"fmt"
	"github.com/codahale/buster"
	"gopkg.in/redis.v5"
	"log"
	"time"
)

var client *redis.ClusterClient
var sha1 string
var keys []string
var argv = make([]interface{}, 5)

const script = `if redis.call("EXISTS", KEYS[1]) == 1 then
    local keyvalues = redis.call("HGETALL", KEYS[1])
    local a = {}
    for i=2, table.getn(ARGV) do
      a[i-1] = ARGV[i]
    end
    local res = redis.call("HMSET", KEYS[1], unpack(a))
    redis.call("EXPIRE", KEYS[1], ARGV[1])
    return keyvalues
else
    return 2 -- "Key doesn't exists"
end`

func initRedis() {
	opts := redis.ClusterOptions{
		Addrs:        []string{"172.16.84.112:7012","172.16.84.118:7012","172.16.84.118:7011","172.16.84.120:7011","172.16.84.120:7012","172.16.84.118:7008","172.16.84.112:7009","172.16.84.112:7008","172.16.84.120:7008","172.16.84.114:7012","172.16.84.120:7009","172.16.84.114:7008","172.16.84.112:7011","172.16.84.114:7011","172.16.84.114:7009","172.16.84.118:7009","172.16.84.114:7009"},
		PoolSize:     6000,
		PoolTimeout:  30 * time.Millisecond,
		DialTimeout:  1 * time.Second,
		ReadTimeout:  20 * time.Millisecond,
		WriteTimeout: 20 * time.Millisecond,
		IdleTimeout:  5 * time.Second,
	}
	client = redis.NewClusterClient(&opts)
	sha1 = client.ScriptLoad(script).Val()
	fmt.Printf("\nScript SHA %s\n", sha1)

	keys = []string{"JJN588de2ffc60b11e689c80242ac1100a51482166271G"}
	argv = make([]interface{}, 5)
	argv[0] = "30000"
	argv[1] = "SSF_lastAccessedDate"
	argv[2] = "1481627386"
	argv[3] = "SSF_expiryDate"
	argv[4] = "1481657386"
}

func main() {
	initRedis()
	bench := buster.Bench{
		Duration:   30 * time.Second,
		MinLatency: 1 * time.Microsecond,
		MaxLatency: 1 * time.Minute,
	}
	r := bench.Run(
		100,  // concurrent workers
		30000, // 1000 ops/sec total
		func(id int, gen *buster.Generator) error { // the job to be run
			return gen.Do(func() error {
				res, err := client.EvalSha(sha1, keys, argv...).Result()
				if err != nil {
					log.Println(err.Error())
					return err
				}
				if _, ok := res.(interface{}); !ok {
					log.Println("Invalid res type")
				}
				return nil
			})
		},
	)
	client.Close()
	fmt.Println(r)
}

The results seems to be quite similar to redis-benchmark:-
871514 successes, 0 failures, 0 errors, 29050.466667 ops/sec
p0.000000 = 0.043100ms
p50.000000 = 0.438100ms
p75.000000 = 0.538200ms
p87.500000 = 0.605900ms
p93.750000 = 0.654600ms
p96.875000 = 0.700900ms
p98.437500 = 0.764900ms
p99.218750 = 0.870000ms
p99.609375 = 0.934800ms
p99.804688 = 0.968800ms
p99.902344 = 0.995400ms
p99.951172 = 1.025300ms
p99.975586 = 1.057200ms
p99.987793 = 1.083200ms
p99.993896 = 1.102400ms
p99.996948 = 1.122600ms
p99.998474 = 1.130600ms
p99.999237 = 1.136900ms
p99.999619 = 1.142900ms
p99.999809 = 1.147700ms
p99.999905 = 1.149200ms
p100.000000 = 1.149200ms

authors: debraj-manna vmihailenco

repo: go-redis/redis


text:
Config

There needs to be some configuration of data providers, already running into inconsistency with id column names in gpkg feature tables.
Pull in & use tegola config handling?

Another option is using the geocatalogo approach:

https://github.com/go-spatial/geocatalogo/blob/master/geocatalogo-config.env
https://github.com/go-spatial/geocatalogo/blob/master/geocatalogo-config.yml

Took care of the blocking problem by adding an auto-config function to the GeoPackage provider which pulls all available features.  I'll leave this open, as people will want to tweak availability but it's much lower priority now.

authors: JivanAmara tomkralidis

repo: go-spatial/go-wfs


text:
generate: YAML parse error in meta doc when using tabs

Problem statement
If you use tabs in the Extensions or SecurityDefinitions fields you will get the following error when trying to generate a spec:
yaml: found character that cannot start any token

This only seems to affect mapping types. For example, Security is a list, and it doesn't seem to matter if you use spaces or tabs.
As an aside, it would be helpful to know where exactly the error is occurring.
Steps to reproduce
Create a file named main.go.
Generate a spec with:
swagger generate spec -o ./swagger.json

This uses tabs and will fail:
//	Security:
//	- api_key:
//
//	SecurityDefinitions:
//	api_key:
//		type: apiKey
//		name: KEY
//		in: header
//
//	Extensions:
//	x-meta-value: value
//
// swagger:meta
package main

func main() {}

This uses spaces and should work:
//  Security:
//  - api_key:
//
//  SecurityDefinitions:
//  api_key:
//      type: apiKey
//      name: KEY
//      in: header
//
//  Extensions:
//  x-meta-value: value
//
// swagger:meta
package main

func main() {}

Environment
swagger version: v0.29.0
go version: go1.18 linux/amd64
OS: Pop!_OS 21.04

I've noticed it works if you do it like this (go 1.19.1, go swagger 0.30.2)

Note the tabs and whitespaces

this should be fixed in the latest release of go-swagger, we now know how to deal with tabs

hello, I met this problem in latest version,is it fixed now? @casualjim

We have this since updating to go 1.19 - using 0.30.4
swagger generate spec --scan-models --output=swagger-ui/swagger.json.new
yaml: line 2: found character that cannot start any token

If only it would tell me which file it's currently looking at, would be a great help, there are many (and line 2 is obviously its preprocessed yaml).   I don't see any "verbose" option.   Any tips for diagnosing where the error might be?

authors: Kangaroux casualjim earthaYan ed-randall-blk tsmethurst

repo: go-swagger/go-swagger


text:
Issue with packr in Docker

Hey 👋
I'm having some trouble with getting it to run in my Docker container, I read through other issues that were dealing with Docker but these didn't help me in this regard.
Building and running locally:
This works fine and everything is as expected, I'm printing List() and Path here in my / Handler to show the problem. The Box is filled in this case.
feedbridge|feature/ui⚡ ⇒ packr build
feedbridge|feature/ui⚡ ⇒ ./feedbridge
ts=2018-08-22T20:13:26.12318744Z caller=main.go:106 msg="feedbridge listening on http://localhost:8080"
[index.tmpl]
./ui/templates
[styles.css tachyons.min.css icon.png]
./ui/assets
^C

Building Multi-Stage Docker image and run packr build -v:
I'm building an image and use packr build -v to show the list of files. It also looks like the Box is packed correctly, at least the files seem to be found by packr. Once I ran it with my docker-compose file the Boxes seem to be empty though.
I'm looking at this for a while now and can't figure it out. Any hints?
Thanks!
feedbridge|feature/ui⚡ ⇒ docker build -t feedbridge-test .
Sending build context to Docker daemon  145.1MB
Step 1/10 : FROM golang:1.10-alpine as builder
 ---> 34d3217973fd
Step 2/10 : WORKDIR $GOPATH/src/github.com/dewey/feedbridge
 ---> Using cache
 ---> 0ccba0adcbf3
Step 3/10 : ADD ./ $GOPATH/src/github.com/dewey/feedbridge
 ---> e0183c6f9ce9
Step 4/10 : RUN apk update &&     apk upgrade &&     apk add git
 ---> Running in de32cef4cc23
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
v3.8.0-88-g3e3519a996 [http://dl-cdn.alpinelinux.org/alpine/v3.8/main]
v3.8.0-88-g3e3519a996 [http://dl-cdn.alpinelinux.org/alpine/v3.8/community]
OK: 9542 distinct packages available
Upgrading critical system libraries and apk-tools:
(1/1) Upgrading apk-tools (2.10.0-r0 -> 2.10.0-r3)
Executing busybox-1.28.4-r0.trigger
Continuing the upgrade transaction with new apk-tools:
(1/2) Upgrading busybox (1.28.4-r0 -> 1.28.4-r1)
Executing busybox-1.28.4-r1.post-upgrade
(2/2) Upgrading ssl_client (1.28.4-r0 -> 1.28.4-r1)
Executing busybox-1.28.4-r1.trigger
OK: 5 MiB in 14 packages
(1/6) Installing nghttp2-libs (1.32.0-r0)
(2/6) Installing libssh2 (1.8.0-r3)
(3/6) Installing libcurl (7.61.0-r0)
(4/6) Installing expat (2.2.5-r0)
(5/6) Installing pcre2 (10.31-r0)
(6/6) Installing git (2.18.0-r0)
Executing busybox-1.28.4-r1.trigger
OK: 19 MiB in 20 packages
Removing intermediate container de32cef4cc23
 ---> e7c1d3652d58
Step 5/10 : RUN go get -u github.com/gobuffalo/packr/... &&     packr build -v -o /feedbridge ./main.go
 ---> Running in f984f5dd48ea
building box ./ui/assets
packing file icon.png
packed file icon.png
packing file styles.css
packed file styles.css
packing file tachyons.min.css
packed file tachyons.min.css
built box ./ui/assets with ["icon.png" "styles.css" "tachyons.min.css"]
building box ./ui/templates
packing file index.tmpl
packed file index.tmpl
built box ./ui/templates with ["index.tmpl"]
github.com/dewey/feedbridge/vendor/github.com/caarlos0/env
github.com/dewey/feedbridge/vendor/github.com/gorilla/feeds
github.com/dewey/feedbridge/vendor/github.com/patrickmn/go-cache
github.com/dewey/feedbridge/plugin
github.com/dewey/feedbridge/vendor/github.com/go-chi/chi
github.com/dewey/feedbridge/store
github.com/dewey/feedbridge/vendor/github.com/go-chi/cors
github.com/dewey/feedbridge/vendor/github.com/go-logfmt/logfmt
github.com/dewey/feedbridge/vendor/github.com/go-stack/stack
github.com/dewey/feedbridge/vendor/golang.org/x/net/html/atom
github.com/dewey/feedbridge/vendor/github.com/go-kit/kit/log
github.com/dewey/feedbridge/vendor/golang.org/x/net/html
github.com/dewey/feedbridge/vendor/github.com/go-kit/kit/log/level
github.com/dewey/feedbridge/api
github.com/dewey/feedbridge/vendor/github.com/beorn7/perks/quantile
github.com/dewey/feedbridge/vendor/github.com/golang/protobuf/proto
github.com/dewey/feedbridge/vendor/github.com/andybalholm/cascadia
github.com/dewey/feedbridge/vendor/github.com/PuerkitoBio/goquery
github.com/dewey/feedbridge/scrape
github.com/dewey/feedbridge/plugins/scmp
github.com/dewey/feedbridge/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
github.com/dewey/feedbridge/vendor/github.com/prometheus/common/model
github.com/dewey/feedbridge/vendor/github.com/prometheus/procfs/internal/util
github.com/dewey/feedbridge/vendor/github.com/prometheus/procfs/nfs
github.com/dewey/feedbridge/vendor/github.com/prometheus/client_model/go
github.com/dewey/feedbridge/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil
github.com/dewey/feedbridge/vendor/github.com/prometheus/procfs/xfs
github.com/dewey/feedbridge/vendor/github.com/prometheus/common/expfmt
github.com/dewey/feedbridge/vendor/github.com/prometheus/procfs
github.com/dewey/feedbridge/vendor/github.com/pkg/errors
github.com/dewey/feedbridge/vendor/github.com/prometheus/client_golang/prometheus
github.com/dewey/feedbridge/vendor/github.com/gobuffalo/packr
github.com/dewey/feedbridge/runner
github.com/dewey/feedbridge/vendor/github.com/prometheus/client_golang/prometheus/promhttp
command-line-arguments
Removing intermediate container f984f5dd48ea
 ---> 34867dbf820b
Step 6/10 : FROM alpine:latest
 ---> 11cd0b38bc3c
Step 7/10 : RUN apk --no-cache add ca-certificates
 ---> Using cache
 ---> a5d3e1451438
Step 8/10 : WORKDIR /root/
 ---> Using cache
 ---> 5953534e3d63
Step 9/10 : COPY --from=builder /feedbridge /feedbridge
 ---> c0290144e21f
Step 10/10 : CMD ["/feedbridge"]
 ---> Running in a43801c8ad61
Removing intermediate container a43801c8ad61
 ---> cb3b6e99852e
Successfully built cb3b6e99852e
Successfully tagged feedbridge-test:latest
feedbridge|feature/ui⚡ ⇒ docker tag feedbridge-test:latest feedbridge-test:staging
feedbridge|feature/ui⚡ ⇒ docker-compose -f docker-compose.yml up
Recreating feedbridge_app_1 ... done
Attaching to feedbridge_app_1
app_1  | ts=2018-08-22T20:17:45.6340962Z caller=main.go:106 msg="feedbridge listening on http://localhost:8080"
app_1  | []
app_1  | ./ui/templates
app_1  | []
app_1  | ./ui/assets
Killing feedbridge_app_1    ... done

Update:
I just tried to look into the both containers to see how the binary in there is like.
The intermediate container used to build the binary with packr build seems to work correctly, the binary has the assets in there.
feedbridge|feature/ui⚡ ⇒ docker run -p 127.0.0.1:8080:8080 -it 3940cc50cf37 /bin/ash
/go/src/github.com/dewey/feedbridge # cd /
/ # ./feedbridge
ts=2018-08-22T21:22:18.5301751Z caller=main.go:106 msg="feedbridge listening on http://localhost:8080"
[index.tmpl]
./ui/templates
[icon.png styles.css tachyons.min.css]
./ui/assets
[index.tmpl]
./ui/templates
[icon.png styles.css tachyons.min.css]
./ui/assets
^C

But now comes the weird part, once I enter the second container, the one where it should just copy over the binary from the first container it doesn't seem to have them? That seems very odd. Almost like it didn't actually bake them into the binary in the first container and is somehow using them from disk?
feedbridge|feature/ui⚡ ⇒ docker run -p 127.0.0.1:8080:8080 -it cb3b6e99852e /bin/ash
~ # cd /
/ # ls
bin         etc         home        media       proc        run         srv         tmp         var
dev         feedbridge  lib         mnt         root        sbin        sys         usr
/ # ./feedbridge
ts=2018-08-22T21:24:04.7353837Z caller=main.go:106 msg="feedbridge listening on http://localhost:8080"
[]
./ui/templates
[]
./ui/assets
[]
./ui/templates
[]
./ui/assets
^C

I'm not sure what's causing that but I "fixed" it by not using the "Easy way" as explained in the README. I'm running packr and then go build now instead of packr build. The latter never actually copied the data in the binary and it only worked because it was doing the fallback to the file system I assume.
Here's the change for my Dockerfile that made it work: https://github.com/dewey/feedbridge/commit/8b1196e218863ff40f90bc621392a776c6d96b0b

This seems similar to #75
-o is the Achilles heel 😂
There is a PR I made explaining the behavior #95.
packr uses Absolute Path I think, so there is a workaround for now that seems to work fine

Looks like https://github.com/gobuffalo/packr/blob/master/packr/cmd/build.go#L28 has the logic for passing the args through to go directly
Which means we can check for -o and manually do a move and remove -o and targetdir(s) from the command list

V2 uses import path resolution now, so this problem should be solved. Please try with v2, and re-open if still a problem. Thanks.

same issue in packr v2

I am also facing the same issue with v2.

authors: dewey dharmjit markbates selfup yetone

repo: gobuffalo/packr


text:
Sample Todo app is broken

Sample todo app http://sample.goby-lang.org/  is currently broken. It's returning invalid JSON at http://sample.goby-lang.org/items.

@jpillora Thanks for reporting! Due to the lack of escaping methods we didn't cover these cases 😢. Fixing now.

@jpillora Already block this kind of content, thanks again 🙏

No worries :)

repo: goby-lang/goby


text:
Support more CHANGELOG.md naming variants

Examples include:

History.md
https://github.com/twilio/twilio-ruby/blob/master/CHANGES.md
https://github.com/rubysec/bundler-audit/blob/master/ChangeLog.md
https://github.com/rspec/rspec-core/blob/master/Changelog.md

I consider this need now met, and @hmarr has ideas for going further with it, to make Bump more knowledgeable about what is the changelog.

repo: gocardless/bump


text:
Changing cell data font and size

How to change the font of cell data?

The package has a "tdStyle" property, which means "Table Data Style", You can do all your text styling here.
Cheers.

@sudheer-palaparambil

authors: Tamunorth sudheer-palaparambil

repo: godilite/editable


text:
Using ColorN for dialog_color is buggy

If ColorN is used, for some reason, the dialog color is reset to white (ignoring any changes made by the developer) when the game is started. The equivalent "color" command doesn't show this bug.

Very strange issue. Approved nevertheless.

authors: StraToN balloonpopper

repo: godot-escoria/escoria-demo-game


text:
display available signals when creating new node

This is one of those quality of life stuff.
I find out that I often add a node just to look at the available signals.
I know that I can look at the docs; but in the heat of the moment, when idea strikes, I want to know what default signals I can have. The setup may look like this.

wait, doesn't it do this already? is there a regression somewhere?

aww nevermind, yeah. +1 QoL feature. possible 3.1 i think maybe iuno

I'm against that, it's overwhelms the interface in a place that is not meant to document nodes. However, a link to the documentation in this panel might not hurt I guess.

very tolerant and nice commnuity imo. run by great leadership skills, you should be proud juan and akien for leading this great floss project!

image is not available now to see the proposal, but otherwise - you can always jump into attached script or go to Node/Signals tab to view them.

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.
The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.
If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

authors: BlenderNPR Calinou CalinouLovesElectronUI DuskKittyIsHotAF dreamsComeTrue girng groud

repo: godotengine/godot


text:
[3.2.3 - "sTaBLe"] Godot Opens 'Project List' when you click Run

Random chance that "Run" will open the Project list but keep the Editor open. Scared that when I export my game, this will just give the player another copy of Godot instead of my game... :(

Duplicate of #28036.

Scared that when I export my game, this will just give the player another copy of Godot instead of my game... :(

This can't happen. When you export a project, you only get a PCK file that includes the resources as if they were imported by Godot.

authors: Calinou ThaddeusWilliams akien-mga


text:
Missing constructor Basis(Vector3)

Godot version
4.0.dev.custom_build. 16edca841
System information
Ubuntu 21.10 - Nvidia GTX 970, Gnome shell 40.4 X11
Issue description
Basis(Vector3())

is now(since this week) not proper constructor
Steps to reproduce
Above
Minimal reproduction project
No response

I can confirm this on 4.0.dev 1aef3a42b.

As I mentioned, this is not a bug, this was removed on purpose. Basis(Vector3) is not a natural constructor (there's no obvious conversion from a Vector3 to a Basis. It used to be used to construct a basis from a set of Euler angle, which is now replaced by an explicit static Basis.from_euler(Vector3).
Tests that use Basis(Vector3) should be changed.

authors: Calinou akien-mga qarmin


text:
Same type of node (Raycast) with exactly the same values delivers a different behaviour

Godot version
3.4.4 - Stable
System information
Wirdows 7 GLES2
Issue description
First of all, sorry for any grammar mistakes in advance, its not my main lenguage, and its my first post. I have a Raycast (3D) that is meant to detect the floor for a KinematicBody. The Body CollisionShape is a Capsule. The floor hes on its a StaticBody with a Boxshape CollisionShape. The raycast is child node of the KinnematicBody and its set to exclude the parent. No other script or node interact in any way with the raycast.
The issue is that when i Enabled my Raycast, it detects the floor sometimes and sometimes it doesnt (in the course of a second, 40 times it will detect it and 20 it wont). I was for hours triying to figure out whats wrong in my code with no luck. Finally, i simply decided to use the same kind of node, with exactly the same values... and it works fine, so in theory the problem is solved. However,  my conclusion is that the problem was not the script, but this particular instance of the raycast. My question is, is this a known issue? can the node become corrupted somehow over time?.
Here we can see 2 identical pairs (all the values are the same) of 3 raycasts (3 of them work fine and 3 of them dont)

When i switch the names of the raycast (not switching any code or properties), it works fine:

Steps to reproduce
I guess this is the biggest problem... any new raycast that i create will work fine, i cant reproduce it. Since my project actually works fine now, i dont have an issue, but i thought it would be best to report it and maybe save someone else a lot of frustrating hours triying to solve something similar.
Minimal reproduction project
No response

@OmegaEd Please upload a minimal reproduction project to make this easier to troubleshoot.
(It's possible that the issue is part of your game logic rather than the engine.)

Closing due to lack of response. Please comment if you can still reproduce this bug.

authors: Calinou OmegaEd


text:
Finding a function that traverses and merges adjacent polygons

Godot version
4.0-beta4
System information
win10
Issue description
Find a function to traverse and merge adjacent polygons. If you write it with "Geometry2D", you will lose polygons. I wonder if there is a bug
Steps to reproduce
Find a function to traverse and merge adjacent polygons. If you write it with "Geometry2D", you will lose polygons. I wonder if there is a bug
Minimal reproduction project
No response

Feature requests should be made in the Godot Proposals repository. Specifically, you should open a discussion in the proposals repository.
This space is for bug reports only.

@xiaoliang6669 Please don't ask support questions here, as this issue tracker is meant to be used for bug reports only. Use one of the other community channels instead.

authors: Calinou clayjohn xiaoliang6669


text:
EditorPlugins that depend on the resources that Node has will not be visible when SubInspector is focused

Godot version
4.0.dev(dc3175e4cdb4e54e1c6200b6c4d07646eea95284)
System information
Any
Issue description
EditorPlugins that depend on the resources that Node has will not be visible when SubInspector is focused.
https://user-images.githubusercontent.com/61938263/210553656-86669f57-e41f-427e-a650-30630c27d850.mp4
This is caused by two problems:
The first is caused by implicit editor deletion in Node3D. This is fixed by #70907.
The other is due to a change in inspector update timing, which is regression by #68498. Revert PR #70909 will fix this issue, but if not, we will need to update SubInspectorEditor in the correct way.
Steps to reproduce
Select Path3D or CollisionPolygon3D and open a SubInspector such as Script.
Minimal reproduction project
plugintest.zip

What is supposed happen when you click on the script resource?

@YuriSizov

What is supposed happen when you click on the script resource?

Nothing happen and it keeps bugging, the Curve/PolygonEditorPlugin in the viewport is hidden.

The path should stay editable in the viewport?

Yes, the SubInspector is only open rather than being focused, and the bug is still happening the moment I select the Node, not just the moment I set the Script.
Perhaps this is because “the process of keeping SubInspector open“ removes the EditorPlugin that depends on other inspector resources. It looks like there may be a fundamental problem somewhere in the Inspector's update method, but I don't know.

This doesn't seem to have anything to do with the update tree changes, other than... it is possible that the old and excessive update tree behavior would self-correct the issue, unintentionally. But otherwise this just looks like our old friend "multiple editor plugins cannot be active at once".

I don't think this is a truth now.

Well, we never changed anything about it, so it's still true. KoBeWi had a plan to add support for multiple plugins to be active at once, but reduz didn't want the complexity and instead it was fixed for the majority of offenders on the case-by-case basis. That's why we have the shader editor always on now. But still many plugins have hacks to work around this limitations.

In practice, this works correctly when you revert the update changes by #70909.

As mentioned, I see no evidence that the changes in that PR had anything to do with your problem, other than perhaps rapid updates were overriding the state of the inspector hiding the issue with these few plugins that are now exposed.

I can't reproduce it in beta8 and master, clicking on the script property in the Inspector always jumps to the script editor, and sets the edited object to that script in the Inspector, just same as disabling interface/inspector/open_resources_in_current_inspector .
Need to modify some settings?

It seems to jump to ScriptEditor if open_resources_in_current_inspector is disabled. It needs to be enabled.

https://user-images.githubusercontent.com/30386067/210568353-6edb44d4-3db1-47dd-9f5b-2090d35685a2.mp4
I deleted the cache dir, config dir, and data dir, and tried again, and it was the same as before.

@Rindbee There is a setting to stop switching to the script editor, I think. But regardless, the issue is reproduceable, I can confirm this.

@Rindbee Maybe it needs to remove 'Script' from Resource to Open in New Inspector.

Probably not completely fixed. At least, Skeleton3DEditor is fixed by #70909 and #70907, but the CurveEditor and CollisionPolygonEditor are still broken by script's SubInspector.

At least, Skeleton3DEditor is fixed by #70909 and #70907, but the CurveEditor and CollisionPolygonEditor are still broken by script's SubInspector.

They get into a bad state by any new edited object: you can click on the Curve resource for the Path node and have the same issue. And you can reproduce it in beta 1 (though not in 3.x, so it is some kind of regression technically).
This all points to the fact that the revert of the optimization wasn't really necessary. The bug is not related to it. The main improvement from the revert is that deselecting the node and then reselecting it now fixes the state of the editor. But folding and unfolding any resource breaks it again.
Long story short: it's the specific plugins that need to be fixed.

The update_tree call should not affect the plug-ins used for nodes, at most it will only affect the plug-ins used for resources.

The update_tree call should not affect the plug-ins used for nodes, at most it will only affect the plug-ins used for resources. Of course there may be some exceptions.

Indeed, these issues have nothing to do with update_tree. Updating the tree is purely a process of recreating the inspector. These issues are about plugins not handling edited objects correctly.

Indeed, the SkeletonEditor bug is fixed by https://github.com/godotengine/godot/pull/70907 only; https://github.com/godotengine/godot/pull/70909 seems to be irrelevant.
Also, I agree that the optimization only mainly causes problems with the Curve resource in the Curve3DEditor (although there was a problem with AnimationPlayerEditor), but that there are bugs independent of the optimization.
If we fix the plugin so that the above script's SubInspector bug does not occur, it is quite possible that the optimization will not cause the bug.
However, I want to avoid clear bugs as we are close to RC for the time being.
So for now, we should fix the plugin before optimization. After that, we recommend reapplying the optimization, taking note of the problem that occurred this time.

Oh, Path3D editor plugin is a convoluted mess. So what happens when you select the script in the Inspector is the following:

Script resources have an editor plugin attached to them, ScriptEditorPlugin, which is a plugin that has a top bar menu; the normal logic for this is to activate the top bar menu to switch to that plugin's view, and naturally hide all other plugins that may be currently visible. For this make_visible is called on all of them, with false being passed to other plugins, including Path3DEditorPlugin.
Path3DEditorPlugin handles this call by hiding parts of the UI it adds (the toolbar), but also by clearing its stored Path3D reference, and sending a changed signal to its Curve3D resource.
When a Curve3D resource attached to a Path3D node changes, it is handled by the Path3D::_curve_changed method, which in turn calls into Node3D::update_gizmos, inherited Node3D. This method is editor-only and is responsible for updating the gizmos, naturally. In this case it adds to the MessageQueue a request to call its internal counterpart that does the actual updating, Node3D::_update_gizmo.
The internal method checks for simple things, it makes sure that the node is still visible in the tree (which it is) and then calls for a redraw on the gizmo object. If the node was not visible, it would call clear. But this time we trigger a redraw.
This brings us back to the Path3DEditorPlugin, or rather its auxiliary class Path3DGizmo. Path3DGizmo::redraw does the normal gizmo object thing and constructs visual elements for the gizmo. This includes a visualization of the curve, as well as handles for controlling said curve. Problem is, handles are only supposed to be drawn for the currently edited path. If we go back to point 2 of this list, we will remind ourselves that we just cleared the edited path. So of course we decide that there is a mismatch and we don't have anything to draw. Thus handles disappear.

Now, you might wonder why we call make_visible on Path3DEditorPlugin in the first place? We never switch to the script editor, so this seems pointless. And I agree. This is pointless, and something that I'm looking into next. At the same time, the handling of make_visible in Path3DEditorPlugin is still questionable. Even if we do switch to the script editor, we probably shouldn't remove the reference of the last edited path from Path3DEditorPlugin. Because when we switch back to the 3D view, the gizmos will be gone anyway as a result. This is in fact what happens in 3.x, so the issue with the plugin dates way back.
So, what should we do? I'll see if we can prevent pointless make_visible calls, which would technically fix the regression. But there is still a buggy behavior in Path3DEditorPlugin that needs fixing by someone who knows more about this plugin than I, it's just consistent with a buggy behavior in 3.x.
Oh, and collision polygons are kind of the same, kind of worse too. They don't have a dedicated plugin. Instead Polygon3DEditorPlugin is used for the polygon part. And Polygon3DEditorPlugin doesn't have its own gizmos. Instead it spawns a mesh instance that has gizmos. Upon receiving make_visible(false) it resets its inner state (by calling edit(nullptr)), effectively removing the mesh instance and all of its bells and whistles.

I guess there is a hint as to why Skeleton3DEditor is working. Skeleton3DEditor now uses SubGizmo, so the place where the drawing is performed may be different from those EditorPlugin. But my memory is a bit hazy...

@TokageItLab Skeleton3DEditor isn't an EditorPlugin, so doesn't appear to implement make_visible at all. It's just a UI element of the inspector plugin, EditorInspectorPluginSkeleton. Their owner, Skeleton3DEditorPlugin, doesn't implement make_visible either.
So yeah, as long the edited object is visible in the inspector, its gizmos should be displayed correctly in this case. Plugins for Path3D and CollisionPolygon3D work independently from the inspector. Maybe that's how they should be rewritten then, no new system needed. Just use subgizmos. Should be pretty easy for Path3D, but not for CollisionPolygon3D due to that intermediate mesh instance.

Okay, I don't think we can fix the issue with clicking on the script resources making gizmos disappear right now. As I mentioned before, this issue also exists in 3.x, you just always switch your view to the script editor. In 4.0 you can remain in the 3D view, but that doesn't really matter much to the issue itself, as the behavior is essentially the same.
Godot editor has a stack of edited objects, and the one selected last is the one that controls which plugins are active, and which are not. Selecting a script, a resource that has a main screen plugin associated with it, makes it the latest selected object, which tells all plugins that handle other objects to hide themselves. This logic is very core to the whole editing and inspecting experience, and I wouldn't want to touch it right now. We should look into improving it in future, but for now I'd leave it as is.
The situation can be improved, as mentioned above, by fixing the plugins themselves, so they don't remove the reference on being hidden, or by using subgizmos.

authors: Rindbee TokageItLab YuriSizov


text:
Area2Ds with monitoring and monitorable flags on don't detect Area2Ds that initially overlap and go from monitorable off to on

Godot version
4.0 beta 12, 3.5.1
bugsquad edit
System information
Windows 10
Issue description
Say I have an Area2D (called Area_A) with monitoring = true and monitorable = true, along with collision_mask bit 1 set to true.  Now take another Area2D (called Area_B) with monitoring = false and monitorable = false, along with collision_layer bit 1 set to true. Now, let's position Area B to overlap Area A. No detection should take place yet since Area B's monitorable = false, currently.  Then, let's set Area B's monitorable = true, and we should see a collision here (assuming that has_overlapping_areas() has been called or the area_entered signal has been set up). However, there is no collision.
If we take Area A and set monitorable = false and try all the same steps again, a collision will be reported.
I would assume based off this behavior, that if both monitorable = true and monitoring = true in the detecting Area2D, it should perform in this same way.
This doesn't look to be a regression, as it exists in 3.5.1 as well, but it does seem like a bug.
Steps to reproduce
Controls for minimal reproduction project:
ui_focus_next (Tab) = Toggle monitorable flag of HitBox (blue)
ui_focus_prev (Shift+Tab) = Toggle monitoring flag of HurtBox (red)
ui_accept (Space) = Toggle monitorable flag of HurtBox (red)
LMB = Toggle monitorable flag of MouseBox (green)
The HitBox is the monitoring area.
The HurtBox and the MouseBox are the monitorable areas.
Minimal reproduction project
Area2DTest.zip

Any possibility we could prioritize this bug for the next release?

As I still encountered this in 4.1.2 and could not find a workaround here, I wrote one myself. It uses the fact that setting the disabled flag on shapes and polygons works. It just disables any collision though, and looses the layer/mask concept.
I use a custom flag for enabling an Area2D:
@export var enabled = true :
	set(value):
		enabled = value
		_update_enabled()

with
func _update_enabled():
	for c in get_children():
		if c is CollisionShape2D or c is CollisionPolygon2D:
			c.disabled = not enabled

Maybe related, with a simpler MRP: https://github.com/godotengine/godot/issues/90077

authors: AdriaandeJongh Granpappy Vennnot felbecker


text:
Shader colors do not work with Panels with a custom StyleBoxFlat

Godot version
v3.5.2.stable.official [170ba337a]
System information
Arch Linux, GLES2 and GLES3, Ryzen Intergrated GPU (Ryzen 5 4500U)
Issue description
Panels with a custom StyleBoxFlat seem to not respond properly to shaders that read + edit color data from the panel. See the screenshot below:

On the left an ImageRect node. On the right a Panel with my theme enabled. Both have the following shader applied: godotshaders.com/shader/circle-pixel
Steps to reproduce

New Scene
User Interface (Control)
Add a Panel to the scene
3a. Add a new Style->Panel "Theme Override" with a "StyleBoxFlat"
3b. Add a new ShaderMaterial with a new Shader file
3c. Paste the above shader (or any other shader that manipulates color) into the shader file
Add a ImageRect to the scene
4a. Add the godot sprite to the image
4b. Add a new ShaderMaterial with a new Shader file
4c. Paste the above shader (or any other shader that manipulates color) into the shader file

Minimal reproduction project
Test.zip

When converting the above test project to Godot 4 (v4.0.1.stable.arch_linux), the issue still occurs, with the addition that the same issue ALSO occurs on the default Panel (no custom StyleBoxFlat).

When converting the above test project to Godot 4 (v4.0.1.stable.arch_linux), the issue still occurs, with the addition that the same issue ALSO occurs on the default Panel (no custom StyleBoxFlat).

The default project theme in 4.0 uses StyleBoxFlats instead of StyleBoxTextures.

It works as expected, the mentioned shader totally ignores the input COLOR (it's inout within the fragment shader), hence the StyleBoxFlat's color (applied to the vertices) ends up being not taken into account. I don't see a bug in here.
Something like this would work as expected:
void fragment() {
	vec4 input_color = COLOR;

	// Somehow incorporate `input_color` into calculations for the `final_color`;
	...

	COLOR = final_color;
}

E.g. within the MRP instead of overwriting the COLOR:
COLOR = c * step(0.0, (0.5* c.a) - dist);

multiplying it by the calculated one:
COLOR *= c * step(0.0, (0.5* c.a) - dist);

would do the thing.

I am really not that big of a shaders person, but how come it works with normal images if it does not do anything with the input color? @kleonc

What I guess I am trying to get across is why are StyleBoxFlats any different from textures in they way shaders are applied to them? Aren't shaders just editing pixels and UV directly? Seems counter-intuitive for difference behaviour for certain objects.
Really sorry if I am being massively naive here

What I guess I am trying to get across is why are StyleBoxFlats any different from textures in they way shaders are applied to them? Aren't shaders just editing pixels and UV directly? Seems counter-intuitive for there to be a difference behaviour for certain types of nodes.

StyleBoxFlat doesn't generate a texture; it generates a polygon that is drawn. This allows scaling to any size without losing quality.

I am really not that big of a shaders person, but how come it works with normal images if it does not do anything with the input color? @kleonc

@CactiChameleon9 The shader you're using "works" with "normal images" because, well, it does sample the texture and uses such color for the final result. And because "normal images" usually have default vertex color (solid white; vec4(1.0)) so the fact it's ignored has no visible effect (as not multiplying by ones gives the same result as multiplying). The issue occurs when you're dealing with non-default vertex color, e.g. like in case of StyleBoxFlat, ColorRect, Line2D.

What I guess I am trying to get across is why are StyleBoxFlats any different from textures in they way shaders are applied to them? Aren't shaders just editing pixels and UV directly? Seems counter-intuitive for there to be a difference behaviour for certain types of nodes.

StyleBoxFlat doesn't generate a texture; it generates a polygon that is drawn. This allows scaling to any size without losing quality.

@Calinou So "texture" in this context means a bitmap? Understood, thanks for that! I guess that makes sense that this does not work the same - however an svg is also not a bitmap (which does seem to behave "normally"). Polygons are different to svgs then.

I am really not that big of a shaders person, but how come it works with normal images if it does not do anything with the input color? @kleonc

@CactiChameleon9 The shader you're using "works" with "normal images" because, well, it does sample the texture and uses such color for the final result. And because "normal images" usually have default vertex color (solid white; vec4(1.0)) so the fact it's ignored has no visible effect (as not multiplying by ones gives the same result as multiplying). The issue occurs when you're dealing with non-default vertex color, e.g. like in case of StyleBoxFlat, ColorRect, Line2D.

@kleonc That makes sense now, thanks for correcting me! Sorry for all the curfuffle I have caused here, but at least I have learnt something.
I will close this issue now, sorry again for the false bug report :sweat_smile:

however an svg is also not a bitmap (but does however seem to behave "normally"). Polygons are different to svgs then.

Godot rasterizes SVGs on import, so all the rendering engine sees is a bitmap.

Godot rasterizes SVGs on import, so all the rendering engine sees is a bitmap.

Just wondering.... hypothetically, would it be possible to rasterize UI such as StyleBoxFlat, ColorRect and Line2D? I assume there would be downsides to this, but if is worth a feature request I can make on in the relevant suggestion repo

Just wondering.... hypothetically, would it be possible to rasterize UI such as StyleBoxFlat, ColorRect and Line2D? I assume there would be downsides to this, but if it is worth a feature request I can make one in the relevant suggestion repo

Yes, by rendering them to a viewport and saving this viewport to a Texture2D. The downside is that you can't scale those without losing quality after doing this.

authors: CactiChameleon9 Calinou kleonc


text:
CharacterBody3D with base script template lags on collision

Godot version
4.0.2.stable (7a0977ce2)
System information
Windows 10, Intel Core i5-9600K, Radeon Pro 580X, Vulkan
Issue description
Everything starts lagging when the player collides with the platform for some reason after I use the base template script, even though it doesn't lag at all in other user demos I've tested. It only seems to lag when I add the script for some reason.
https://github.com/godotengine/godot/assets/106000036/36f3c484-6c3f-4176-9be9-7855475c7a35
The video, for some reason, also lags when the player isn't on the platform, (something must have been up with OBS) but it does lag as the video shows when the player is on the platform
Not sure if there's a simple step to fix this but I've been having this problem since I installed version 4 recently and couldn't find any solution on line, no matter how many keywords I add.
Steps to reproduce
Create a MeshInstance3D and assign a StaticBody and CollisionShape. Create a CharacterBody3D and assign a MeshInstance and CollisionShape. Give the CharacterBody a script, use the Basic Movement template, add camera, test scene.
Minimal reproduction project
scene.zip

I found out that the problem was the CollisionShape. Just for future reference, if this happens to anyone else, remember to choose CapsuleShape for the CollisionShape instead of making it from the mesh. This seems to cause an issue and make everything lag when colliding with other objects.

@brickedware making the shape from the mesh makes it too complex - this is a known already reported issue. Unless you really really need to make it from the mesh, using built-in shapes is in general a good rule of thumb (is this documented prominently enough in the physics docs pages though?)


text:
Android Editor on save "The following files are newer on disk".

Godot version
v4.2.dev5.official [e3e2528ba]
(Has been the case on all 4.x versions I've tried)
System information
Godot v4.2.dev5 - Android - Vulkan (Mobile) - integrated Adreno (TM) 740 -  (8 Threads)
Samsung S23, Android 13
Issue description
Saving script files prompts me with a "The following files are newer on disk" dialog. This happens maybe every other time I save.
I've tried granting file access permissions to the editor app through ADB and moving the project to the Documents folder, but nothing stops this dialog from popping up.

Steps to reproduce
Save any file using the Android editor.
Minimal reproduction project
Just create any empty project and try saving a script a few times.

Which device model and Android version are you using?

Which device model and Android version are you using?

Samsung S23, Android 13

Happens to me on an S22 Ultra as well, Android 13. Has happened since 4.0.

Still an issue on 4.2 Beta 5

authors: BSChad Calinou iwilliams