This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix the check for whether is_url
to match all the other ones in codebase
#3405
Merged
richvdh
merged 5 commits into
matrix-org:develop
from
t3chguy:t3chguy/fix_contains-url_filtering
Jan 6, 2019
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9cd62a2
fix the check for whether `is_url` to match all the other ones in cod…
t3chguy f2f76cb
make linter happy
t3chguy cfc0e13
apply PR feedback
t3chguy 41d9ed2
comply with isort
t3chguy fcd3861
make it even more like the other instance and add newsfragment
t3chguy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix contains_url check to be consistent with other instances in code-base and check that value is an instance of string. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the spec says "includes only events with a url key in their content"
it doesn't say it has to be a string...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(this might be a good opportunity to clarify the spec so it makes sense)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, if there are compelling reasons to do so, then sure, let's change the spec. Are there, though?
[if you actually want to check it's a string, you probably want
six.string_types
rather thansix.text_type
]There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's not really a use case for a singular-named variable to contain an object/array, and it's somewhat implied it is a string anyways. Might as well just say it is a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, but (a) that's not quite the same as 'filters have to check for the stringiness' and (b) "might as well" doesn't sound worth the effort of changing the spec to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richvdh, existing code disagrees:
synapse/synapse/storage/events.py
Lines 1575 to 1577 in bc80b3f