Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix residual typos found by codespell
Browse files Browse the repository at this point in the history
DimitriPapadopoulos committed Jul 27, 2023
1 parent c05dfb3 commit fa6d27f
Showing 31 changed files with 52 additions and 52 deletions.
12 changes: 6 additions & 6 deletions doc/communication.md
Original file line number Diff line number Diff line change
@@ -2,13 +2,13 @@

## First login and sync

When user logs in to the bridge for the first time, immediatelly starts the first sync.
When user logs in to the bridge for the first time, immediately starts the first sync.
First sync downloads all headers of all e-mails and creates database to have proper UIDs
and indexes for IMAP. See [database](database.md) for more information.

By default, whenever it's possible, sync downloads only all e-mails maiblox which already
have list of labels so we can construct all mailboxes (inbox, sent, trash, custom folders
and lables) without need to download each e-mail headers many times.
and labels) without need to download each e-mail headers many times.

Note that we need to download also bodies to calculate size of the e-mail and set proper
content type (clients uses content type for guess if e-mail contains attachment)--but only
@@ -22,7 +22,7 @@ client right after adding account.

When account is added to client, client start the sync. This sync will ask Bridge app
for all headers (done quickly) and then starts to download all bodies and attachment.
Unfortunatelly for some e-mail more than once if the same e-mail is in more mailboxes
Unfortunately for some e-mail more than once if the same e-mail is in more mailboxes
(e.g. inbox and all mail)--there is no way to tell over IMAP it's the same message.

After successful login of client to IMAP, Bridge starts event loop. That periodicly ask
@@ -37,7 +37,7 @@ sequenceDiagram
Note right of B: Set up PM account<br/>by user
loop First sync
B ->> S: Fetch body and attachements
B ->> S: Fetch body and attachments
Note right of B: Build local database<br/>(e-mail UIDs)
end
@@ -58,8 +58,8 @@ sequenceDiagram
C ->> B: IMAP SELECT directory
C ->> B: IMAP SEARCH e-mails UIDs
C ->> B: IMAP FETCH of e-mail UID
B ->> S: Fetch body and attachements
Note right of B: Decrypt message<br/>and attachement
B ->> S: Fetch body and attachments
Note right of B: Decrypt message<br/>and attachment
B ->> C: IMAP response
end
```
6 changes: 3 additions & 3 deletions doc/updates.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Update mechanism of Bridge

There are mulitple options how to change version of application:
There are multiple options how to change version of application:
* Automatic in-app update
* Manual in-app update
* Manual install

In-app update ends with restarting bridge into new version. Automatic in-app
update is downloading, verifying and installing the new version immediatelly
update is downloading, verifying and installing the new version immediately
without user confirmation. For manual in-app update user needs to confirm first.
Update is done from special update file published on website.

@@ -25,7 +25,7 @@ The bridge is installed and executed differently for given OS:

* macOS app does not use launcher
* No launcher, only one executable
* In-App udpate replaces the bridge files in installation path directly
* In-App update replaces the bridge files in installation path directly


```mermaid
2 changes: 1 addition & 1 deletion internal/bridge/smtp.go
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ func newSMTPServer(bridge *Bridge, tlsConfig *tls.Config, logSMTP bool) *smtp.Se
smtpServer.MaxLineLength = 1 << 16
smtpServer.ErrorLog = logging.NewSMTPLogger()

// go-smtp suppors SASL PLAIN but not LOGIN. We need to add LOGIN support ourselves.
// go-smtp supports SASL PLAIN but not LOGIN. We need to add LOGIN support ourselves.
smtpServer.EnableAuth(sasl.Login, func(conn *smtp.Conn) sasl.Server {
return sasl.NewLoginServer(func(username, password string) error {
return conn.Session().AuthPlain(username, password)
2 changes: 1 addition & 1 deletion internal/bridge/sync_unix_test.go
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ import (
"github.com/stretchr/testify/require"
)

// Disabled due to flakyness.
// Disabled due to flakiness.
func _TestBridge_SyncExistsWithErrorWhenTooManyFilesAreOpen(t *testing.T) { //nolint:unused
var rlimitCurrent syscall.Rlimit

2 changes: 1 addition & 1 deletion internal/frontend/bridge-gui/bridge-gui-tester/Doxyfile
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ CREATE_SUBDIRS = YES
# level increment doubles the number of directories, resulting in 4096
# directories at level 8 which is the default and also the maximum value. The
# sub-directories are organized in 2 levels, the first level always has a fixed
# numer of 16 directories.
# number of 16 directories.
# Minimum value: 0, maximum value: 8, default value: 8.
# This tag requires that the tag CREATE_SUBDIRS is set to YES.

Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ Status GRPCMetadataProcessor::Process(AuthMetadataProcessor::InputMetadata const
AuthMetadataProcessor::OutputMetadata *, AuthMetadataProcessor::OutputMetadata *) {
try {
AuthMetadataProcessor::InputMetadata::const_iterator pathIt = auth_metadata.find(":path");
QString const callName = (pathIt == auth_metadata.end()) ? ("unkown gRPC call") : QString::fromLocal8Bit(pathIt->second);
QString const callName = (pathIt == auth_metadata.end()) ? ("Unknown gRPC call") : QString::fromLocal8Bit(pathIt->second);

AuthMetadataProcessor::InputMetadata::size_type const count = auth_metadata.count(grpcMetadataServerTokenKey);
if (count == 0) {
Original file line number Diff line number Diff line change
@@ -146,8 +146,8 @@ void GRPCQtProxy::setClientPlatform(QString const &clientPlatform) {
//****************************************************************************************************************************************************
/// \param[in] imapPort The IMAP port.
/// \param[in] smtpPort The SMTP port.
/// \param[in] useSSLForIMAP The IMAP connexion mode.
/// \param[in] useSSLForSMTP The IMAP connexion mode.
/// \param[in] useSSLForIMAP The IMAP connection mode.
/// \param[in] useSSLForSMTP The IMAP connection mode.
//****************************************************************************************************************************************************
void GRPCQtProxy::setMailServerSettings(qint32 imapPort, qint32 smtpPort, bool useSSLForIMAP, bool userSSLForSMTP) {
emit setMailServerSettingsReceived(imapPort, smtpPort, useSSLForIMAP, userSSLForSMTP);
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ class GRPCService : public grpc::Bridge::Service {

private: // data member
mutable QMutex eventStreamMutex_; ///< Mutex used to access eventQueue_, isStreaming_ and shouldStopStreaming_;
QList<bridgepp::SPStreamEvent> eventQueue_; ///< The event queue. Acces protected by eventStreamMutex_;
QList<bridgepp::SPStreamEvent> eventQueue_; ///< The event queue. Access protected by eventStreamMutex_;
bool isStreaming_; ///< Is the gRPC stream running. Access protected by eventStreamMutex_;
bool eventStreamShouldStop_; ///< Should the stream be stopped? Access protected by eventStreamMutex
QString loginUsername_; ///< The username used for the current login procedure.
Original file line number Diff line number Diff line change
@@ -346,8 +346,8 @@ qint32 SettingsTab::smtpPort() {
//****************************************************************************************************************************************************
/// \param[in] imapPort The IMAP port.
/// \param[in] smtpPort The SMTP port.
/// \param[in] useSSLForIMAP The IMAP connexion mode.
/// \param[in] useSSLForSMTP The IMAP connexion mode.
/// \param[in] useSSLForIMAP The IMAP connection mode.
/// \param[in] useSSLForSMTP The IMAP connection mode.
//****************************************************************************************************************************************************
void SettingsTab::setMailServerSettings(qint32 imapPort, qint32 smtpPort, bool useSSLForIMAP, bool useSSLForSMTP) {
ui_.spinPortIMAP->setValue(imapPort);
Original file line number Diff line number Diff line change
@@ -378,7 +378,7 @@
</size>
</property>
<property name="title">
<string>TLS Certficates</string>
<string>TLS Certificates</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@ void UsersTab::onSendUserBadEvent() {
int const index = this->selectedIndex();

if (!user) {
app().log().error(QString("%1 failed. Unkown user.").arg(__FUNCTION__));
app().log().error(QString("%1 failed. Unknown user.").arg(__FUNCTION__));
return;
}

@@ -167,7 +167,7 @@ void UsersTab::onSendUsedBytesChangedEvent() {
int const index = this->selectedIndex();

if (!user) {
app().log().error(QString("%1 failed. Unkown user.").arg(__FUNCTION__));
app().log().error(QString("%1 failed. Unknown user.").arg(__FUNCTION__));
return;
}

Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@
<item row="3" column="0">
<widget class="QLabel" name="labelAddresses">
<property name="text">
<string>Adresses</string>
<string>Addresses</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
2 changes: 1 addition & 1 deletion internal/frontend/bridge-gui/bridge-gui/QMLBackend.h
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ Q_OBJECT
void showSettings(QString const &reason); ///< Show the settings page.
void selectUser(QString const &userID, bool forceShowWindow, QString const &reason); ///< Select the user and display its account details (or login screen).

// invokable methods can be called from QML. They generally return a value, which slots cannot do.
// invocable methods can be called from QML. They generally return a value, which slots cannot do.
Q_INVOKABLE static QString buildYear(); ///< Return the application build year.
Q_INVOKABLE QPoint getCursorPos() const; ///< Retrieve the cursor position.
Q_INVOKABLE bool isPortFree(int port) const; ///< Check if a given network port is available.
2 changes: 1 addition & 1 deletion internal/frontend/bridge-gui/bridge-gui/build.sh
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ BRIDGE_BUILD_ENV= ${BRIDGE_BUILD_ENV:-"dev"}
git submodule update --init --recursive ${VCPKG_ROOT}
check_exit "Failed to initialize vcpkg as a submodule."

echo submodule udpated
echo submodule updated

VCPKG_EXE="${VCPKG_ROOT}/vcpkg"
VCPKG_BOOTSTRAP="${VCPKG_ROOT}/bootstrap-vcpkg.sh"
2 changes: 1 addition & 1 deletion internal/frontend/bridge-gui/bridgepp/Doxyfile
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ CREATE_SUBDIRS = YES
# level increment doubles the number of directories, resulting in 4096
# directories at level 8 which is the default and also the maximum value. The
# sub-directories are organized in 2 levels, the first level always has a fixed
# numer of 16 directories.
# number of 16 directories.
# Minimum value: 0, maximum value: 8, default value: 8.
# This tag requires that the tag CREATE_SUBDIRS is set to YES.

Original file line number Diff line number Diff line change
@@ -78,10 +78,10 @@ void FocusGRPCClient::removeServiceConfigFile(QString const &configDir) {


//****************************************************************************************************************************************************
/// \param[in] timeoutMs The timeout for the connexion.
/// \param[in] timeoutMs The timeout for the connection.
/// \param[in] port The gRPC server port.
/// \param[out] outError if not null and the function returns false.
/// \return true iff the connexion was successfully established.
/// \return true iff the connection was successfully established.
//****************************************************************************************************************************************************
bool FocusGRPCClient::connectToServer(qint64 timeoutMs, quint16 port, QString *outError) {
try {
@@ -97,7 +97,7 @@ bool FocusGRPCClient::connectToServer(qint64 timeoutMs, quint16 port, QString *o
}

if (channel_->GetState(true) != GRPC_CHANNEL_READY) {
throw Exception("Connexion check with focus service failed.");
throw Exception("Connection check with focus service failed.");
}

log_.debug(QString("Successfully connected to focus gRPC service."));
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ void GRPCClient::removeServiceConfigFile(QString const &configDir) {

//****************************************************************************************************************************************************
/// \param[in] timeoutMs The timeout in milliseconds
/// \param[in] serverProcess An optional server process to monitor. If the process it, no need and retry, as connexion cannot be established. Ignored if null.
/// \param[in] serverProcess An optional server process to monitor. If the process it, no need and retry, as connection cannot be established. Ignored if null.
/// \return The service config.
//****************************************************************************************************************************************************
GRPCConfig GRPCClient::waitAndRetrieveServiceConfig(QString const &configDir, qint64 timeoutMs, ProcessMonitor *serverProcess) {
@@ -114,7 +114,7 @@ void GRPCClient::setLog(Log *log) {


//****************************************************************************************************************************************************
/// \param[in] serverProcess An optional server process to monitor. If the process it, no need and retry, as connexion cannot be established. Ignored if null.
/// \param[in] serverProcess An optional server process to monitor. If the process it, no need and retry, as connection cannot be established. Ignored if null.
/// \return true iff the connection was successful.
//****************************************************************************************************************************************************
void GRPCClient::connectToServer(QString const &configDir, GRPCConfig const &config, ProcessMonitor *serverProcess) {
@@ -146,7 +146,7 @@ void GRPCClient::connectToServer(QString const &configDir, GRPCConfig const &con
int i = 0;
while (true) {
if (serverProcess && serverProcess->getStatus().ended) {
throw Exception("Bridge application ended before gRPC connexion could be established.", QString(), __FUNCTION__,
throw Exception("Bridge application ended before gRPC connection could be established.", QString(), __FUNCTION__,
tailOfLatestBridgeLog());
}

2 changes: 1 addition & 1 deletion internal/frontend/grpc/service_methods.go
Original file line number Diff line number Diff line change
@@ -461,7 +461,7 @@ func (s *Service) Login2FA(_ context.Context, login *LoginRequest) (*emptypb.Emp
defer async.HandlePanic(s.panicHandler)

if s.auth.UID == "" || s.authClient == nil {
s.log.Errorf("Login 2FA: authethication incomplete %s %p", s.auth.UID, s.authClient)
s.log.Errorf("Login 2FA: authentication incomplete %s %p", s.auth.UID, s.authClient)
_ = s.SendEvent(NewLoginError(LoginErrorType_TFA_ABORT, "Missing authentication, try again."))
s.loginClean()
return
4 changes: 2 additions & 2 deletions internal/logging/logging.go
Original file line number Diff line number Diff line change
@@ -34,11 +34,11 @@ import (
const (
// MaxLogSize defines the maximum log size we should permit: 5 MB
//
// The Zendesk limit for an attachement is 50MB and this is what will
// The Zendesk limit for an attachment is 50MB and this is what will
// be allowed via the API. However, if that fails for some reason, the
// fallback is sending the report via email, which has a limit of 10mb
// total or 7MB per file. Since we can produce up to 6 logs, and we
// compress all the files (avarage compression - 80%), we need to have
// compress all the files (average compression - 80%), we need to have
// a limit of 30MB total before compression, hence 5MB per log file.
MaxLogSize = 5 * 1024 * 1024

2 changes: 1 addition & 1 deletion internal/user/sync.go
Original file line number Diff line number Diff line change
@@ -320,7 +320,7 @@ func (user *User) syncMessages(
case maxSyncMemory == 2*Gigabyte:
// Increasing the max download capacity has very little effect on sync speed. We could increase the download
// memory but the user would see less sync notifications. A smaller value here leads to more frequent
// updates. Additionally, most of ot sync time is spent in the message building.
// updates. Additionally, most of sync time is spent in the message building.
syncMaxDownloadRequestMem = MaxDownloadRequestMem
// Currently limited so that if a user has multiple accounts active it also doesn't cause excessive memory usage.
syncMaxMessageBuildingMem = MaxMessageBuildingMem
2 changes: 1 addition & 1 deletion pkg/cpc/cpc.go
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ import (

var ErrInvalidReplyType = errors.New("reply type does not match")

// Utilities to implement Chanel Procedure Calls. Similar in concept to RPC, but with between go-routines.
// Utilities to implement Channel Procedure Calls. Similar in concept to RPC, but with between go-routines.

// Request contains the data for a request as well as the means to reply to a request.
type Request struct {
2 changes: 1 addition & 1 deletion pkg/keychain/helper_darwin.go
Original file line number Diff line number Diff line change
@@ -115,7 +115,7 @@ func (h *macOSHelper) Get(secretURL string) (string, string, error) {

results, err := keychain.QueryItem(query)
if err != nil {
l.WithError(err).Error("Querry item failed")
l.WithError(err).Error("Query item failed")
return "", "", parseError(err)
}

6 changes: 3 additions & 3 deletions pkg/mime/encoding.go
Original file line number Diff line number Diff line change
@@ -205,11 +205,11 @@ func EncodeHeader(s string) string {
return mime.QEncoding.Encode("utf-8", s)
}

// DecodeCharset decodes the orginal using content type parameters.
// DecodeCharset decodes the original using content type parameters.
// If the charset parameter is missing it checks that the content is valid utf8.
// If it isn't, it checks if it's embedded in the html/xml.
// If it isn't, it falls back to windows-1252.
// It then reencodes it as utf-8.
// It then re-encodes it as utf-8.
func DecodeCharset(original []byte, contentType string) ([]byte, error) {
// If the contentType itself is specified, use that.
if contentType != "" {
@@ -240,7 +240,7 @@ func DecodeCharset(original []byte, contentType string) ([]byte, error) {
logrus.WithField("encoding", name).Warn("Determined encoding but was not certain")
}

// Reencode as UTF-8.
// Re-encode as UTF-8.
decoded, err := encoding.NewDecoder().Bytes(original)
if err != nil {
return original, errors.Wrap(err, "failed to decode as windows-1252")
2 changes: 1 addition & 1 deletion pkg/mime/encoding_test.go
Original file line number Diff line number Diff line change
@@ -446,7 +446,7 @@ func TestEncodeReader(t *testing.T) {
}

if bytes.Equal(decoded, expected) {
// fmt.Println("Succesfull decoding of ", val.params, ":", string(decoded))
// fmt.Println("Successful decoding of ", val.params, ":", string(decoded))
} else {
t.Error("Wrong encoding of ", val.charset, ".Expected\n", expected, "\nbut have\n", decoded)
}
2 changes: 1 addition & 1 deletion pkg/tar/tar.go
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ import (
"github.com/sirupsen/logrus"
)

// maxFileSize limit tre single file size after decopression is not larger than 1GB.
// maxFileSize limit the single file size after decopression is not larger than 1GB.
const maxFileSize = int64(1 * 1024 * 1024 * 1024) // 1 GB

// ErrFileTooLarge returned when decompressed file is too large.
4 changes: 2 additions & 2 deletions release-notes/bridge_early.md
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@
- Improved Sentry reporting

### Fixed
- Ensure messageID is properly removed from DB when it is no logner present on the API
- Ensure messageID is properly removed from DB when it is no longer present on the API


## v2.1.0
@@ -372,7 +372,7 @@ New local cache
- Added IMAP requests to the logs for easier debugging

### Fixed
- NoGUI bulid
- NoGUI build
- Background of GUI welcome message
- Incorrect total mailbox size displayed in Apple Mail

4 changes: 2 additions & 2 deletions release-notes/bridge_stable.md
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@
- Improved Sentry reporting

### Fixed
- Ensure messageID is properly removed from DB when it is no logner present on the API
- Ensure messageID is properly removed from DB when it is no longer present on the API


## v2.1.0
@@ -251,7 +251,7 @@ Other
- Fixed GUI freeze while switching to early update channel
- Fixed Bridge autostart
- Improved signing of update packages
- NoGUI bulid
- NoGUI build
- Background of GUI welcome message
- Incorrect total mailbox size displayed in Apple Mail

2 changes: 1 addition & 1 deletion utils/QTBUG-88600/README.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This is version of libqcocoa obtained from original Qt 5.13.0 source available at https://github.com/qt/qtbase with patch from cocoa.patch applyed.
This is version of libqcocoa obtained from original Qt 5.13.0 source available at https://github.com/qt/qtbase with patch from cocoa.patch applied.

Please refer to https://bugreports.qt.io/browse/QTBUG-88600 for patch origin and https://doc.qt.io/qt-5/macos-building.html for instructions how to build Qt from source.
4 changes: 2 additions & 2 deletions utils/changelog_linter.sh
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ echo "0">$ERROR_COUNT_FILE
# -- Helper functions -- #
##########################

# err print out a given error ($2) and line where it hapens ($1),
# err print out a given error ($2) and line where it happens ($1),
# also it increases count of errors.
err () {
echo "CHANGELOG-LINTER: $2 on the following line:"
@@ -92,7 +92,7 @@ check_change_types () {

case "$1" in
"### Added"|"### Changed"|"### Deprecated"|"### Removed"|"### Fixed"|"### Security") ;; # Standard keepachangelog.com compliant types.
"### Release notes"|"### Fixed bugs") ;; # Bridge aditional in app release notes types.
"### Release notes"|"### Fixed bugs") ;; # Bridge additional in app release notes types.
"### Guiding Principles"|"### Types of changes") ;; # Ignoring guide at the end of the changelog.
*) err "$1" "Change type must be one of the Added, Changed, Deprecated, Removed, Fixed, Hoftix"
esac
2 changes: 1 addition & 1 deletion utils/dependency_license.sh
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ generate_dep_licenses(){
grep -E $'^\t[^=>]*$' $src | sed -r 's/\t([^ ]*) v.*/\1/g' > "$tmpDepLicenses"
grep -E $'^\t.*=>.*v.*$' $src | sed -r 's/^.*=> ([^ ]*)( v.*)?/\1/g' >> "$tmpDepLicenses"

# Replace each line with formated link
# Replace each line with formatted link
sed -i -r '/^github.com\/therecipe\/qt\/internal\/binding\/files\/docs\//d;' "$tmpDepLicenses"
sed -i -r 's|^(.*)/([[:alnum:]-]+)/(v[[:digit:]]+)$|* [\2](https://\1/\2/\3)|g' "$tmpDepLicenses"
sed -i -r 's|^(.*)/([[:alnum:]-]+)$|* [\2](https://\1/\2)|g' "$tmpDepLicenses"
4 changes: 2 additions & 2 deletions utils/remove_non_relative_links_darwin.sh
Original file line number Diff line number Diff line change
@@ -20,10 +20,10 @@
# The Qt libs are dynamically loaded with rules like: `@rpath/QtGui.framework/Versions/5/QtGui`
# @rpath instructs the dynamic linker to search a list of paths in order to locate the framework
# The rules can be listed using `otool -l "${path_to_binary}"`
# The building process of therecipe/qt or qmake leaves the rules with additinal unwanted paths
# The building process of therecipe/qt or qmake leaves the rules with additional unwanted paths
# + absolute path to build directory
# + dummy replacement `/break_the_rpath`
# We need to manually remove those and add the path relative to exectuable: `@executable_path/../Frameworks`
# We need to manually remove those and add the path relative to executable: `@executable_path/../Frameworks`

path_to_binary=$1

0 comments on commit fa6d27f

Please sign in to comment.